import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectNonNull as __expectNonNull , expectString as __expectString , extendedEncodeURIComponent as __extendedEncodeURIComponent , getArrayIfSingleItem as __getArrayIfSingleItem , getValueFromTextNode as __getValueFromTextNode , parseBoolean as __parseBoolean , parseRfc3339DateTime as __parseRfc3339DateTime , strictParseInt32 as __strictParseInt32 , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { decodeHTML } from "entities" ; import { parse as xmlParse } from "fast-xml-parser" ; import { AddClientIDToOpenIDConnectProviderCommandInput , AddClientIDToOpenIDConnectProviderCommandOutput , } from "../commands/AddClientIDToOpenIDConnectProviderCommand" ; import { AddRoleToInstanceProfileCommandInput , AddRoleToInstanceProfileCommandOutput , } from "../commands/AddRoleToInstanceProfileCommand" ; import { AddUserToGroupCommandInput , AddUserToGroupCommandOutput } from "../commands/AddUserToGroupCommand" ; import { AttachGroupPolicyCommandInput , AttachGroupPolicyCommandOutput } from "../commands/AttachGroupPolicyCommand" ; import { AttachRolePolicyCommandInput , AttachRolePolicyCommandOutput } from "../commands/AttachRolePolicyCommand" ; import { AttachUserPolicyCommandInput , AttachUserPolicyCommandOutput } from "../commands/AttachUserPolicyCommand" ; import { ChangePasswordCommandInput , ChangePasswordCommandOutput } from "../commands/ChangePasswordCommand" ; import { CreateAccessKeyCommandInput , CreateAccessKeyCommandOutput } from "../commands/CreateAccessKeyCommand" ; import { CreateAccountAliasCommandInput , CreateAccountAliasCommandOutput } from "../commands/CreateAccountAliasCommand" ; import { CreateGroupCommandInput , CreateGroupCommandOutput } from "../commands/CreateGroupCommand" ; import { CreateInstanceProfileCommandInput , CreateInstanceProfileCommandOutput , } from "../commands/CreateInstanceProfileCommand" ; import { CreateLoginProfileCommandInput , CreateLoginProfileCommandOutput } from "../commands/CreateLoginProfileCommand" ; import { CreateOpenIDConnectProviderCommandInput , CreateOpenIDConnectProviderCommandOutput , } from "../commands/CreateOpenIDConnectProviderCommand" ; import { CreatePolicyCommandInput , CreatePolicyCommandOutput } from "../commands/CreatePolicyCommand" ; import { CreatePolicyVersionCommandInput , CreatePolicyVersionCommandOutput , } from "../commands/CreatePolicyVersionCommand" ; import { CreateRoleCommandInput , CreateRoleCommandOutput } from "../commands/CreateRoleCommand" ; import { CreateSAMLProviderCommandInput , CreateSAMLProviderCommandOutput } from "../commands/CreateSAMLProviderCommand" ; import { CreateServiceLinkedRoleCommandInput , CreateServiceLinkedRoleCommandOutput , } from "../commands/CreateServiceLinkedRoleCommand" ; import { CreateServiceSpecificCredentialCommandInput , CreateServiceSpecificCredentialCommandOutput , } from "../commands/CreateServiceSpecificCredentialCommand" ; import { CreateUserCommandInput , CreateUserCommandOutput } from "../commands/CreateUserCommand" ; import { CreateVirtualMFADeviceCommandInput , CreateVirtualMFADeviceCommandOutput , } from "../commands/CreateVirtualMFADeviceCommand" ; import { DeactivateMFADeviceCommandInput , DeactivateMFADeviceCommandOutput , } from "../commands/DeactivateMFADeviceCommand" ; import { DeleteAccessKeyCommandInput , DeleteAccessKeyCommandOutput } from "../commands/DeleteAccessKeyCommand" ; import { DeleteAccountAliasCommandInput , DeleteAccountAliasCommandOutput } from "../commands/DeleteAccountAliasCommand" ; import { DeleteAccountPasswordPolicyCommandInput , DeleteAccountPasswordPolicyCommandOutput , } from "../commands/DeleteAccountPasswordPolicyCommand" ; import { DeleteGroupCommandInput , DeleteGroupCommandOutput } from "../commands/DeleteGroupCommand" ; import { DeleteGroupPolicyCommandInput , DeleteGroupPolicyCommandOutput } from "../commands/DeleteGroupPolicyCommand" ; import { DeleteInstanceProfileCommandInput , DeleteInstanceProfileCommandOutput , } from "../commands/DeleteInstanceProfileCommand" ; import { DeleteLoginProfileCommandInput , DeleteLoginProfileCommandOutput } from "../commands/DeleteLoginProfileCommand" ; import { DeleteOpenIDConnectProviderCommandInput , DeleteOpenIDConnectProviderCommandOutput , } from "../commands/DeleteOpenIDConnectProviderCommand" ; import { DeletePolicyCommandInput , DeletePolicyCommandOutput } from "../commands/DeletePolicyCommand" ; import { DeletePolicyVersionCommandInput , DeletePolicyVersionCommandOutput , } from "../commands/DeletePolicyVersionCommand" ; import { DeleteRoleCommandInput , DeleteRoleCommandOutput } from "../commands/DeleteRoleCommand" ; import { DeleteRolePermissionsBoundaryCommandInput , DeleteRolePermissionsBoundaryCommandOutput , } from "../commands/DeleteRolePermissionsBoundaryCommand" ; import { DeleteRolePolicyCommandInput , DeleteRolePolicyCommandOutput } from "../commands/DeleteRolePolicyCommand" ; import { DeleteSAMLProviderCommandInput , DeleteSAMLProviderCommandOutput } from "../commands/DeleteSAMLProviderCommand" ; import { DeleteServerCertificateCommandInput , DeleteServerCertificateCommandOutput , } from "../commands/DeleteServerCertificateCommand" ; import { DeleteServiceLinkedRoleCommandInput , DeleteServiceLinkedRoleCommandOutput , } from "../commands/DeleteServiceLinkedRoleCommand" ; import { DeleteServiceSpecificCredentialCommandInput , DeleteServiceSpecificCredentialCommandOutput , } from "../commands/DeleteServiceSpecificCredentialCommand" ; import { DeleteSigningCertificateCommandInput , DeleteSigningCertificateCommandOutput , } from "../commands/DeleteSigningCertificateCommand" ; import { DeleteSSHPublicKeyCommandInput , DeleteSSHPublicKeyCommandOutput } from "../commands/DeleteSSHPublicKeyCommand" ; import { DeleteUserCommandInput , DeleteUserCommandOutput } from "../commands/DeleteUserCommand" ; import { DeleteUserPermissionsBoundaryCommandInput , DeleteUserPermissionsBoundaryCommandOutput , } from "../commands/DeleteUserPermissionsBoundaryCommand" ; import { DeleteUserPolicyCommandInput , DeleteUserPolicyCommandOutput } from "../commands/DeleteUserPolicyCommand" ; import { DeleteVirtualMFADeviceCommandInput , DeleteVirtualMFADeviceCommandOutput , } from "../commands/DeleteVirtualMFADeviceCommand" ; import { DetachGroupPolicyCommandInput , DetachGroupPolicyCommandOutput } from "../commands/DetachGroupPolicyCommand" ; import { DetachRolePolicyCommandInput , DetachRolePolicyCommandOutput } from "../commands/DetachRolePolicyCommand" ; import { DetachUserPolicyCommandInput , DetachUserPolicyCommandOutput } from "../commands/DetachUserPolicyCommand" ; import { EnableMFADeviceCommandInput , EnableMFADeviceCommandOutput } from "../commands/EnableMFADeviceCommand" ; import { GenerateCredentialReportCommandInput , GenerateCredentialReportCommandOutput , } from "../commands/GenerateCredentialReportCommand" ; import { GenerateOrganizationsAccessReportCommandInput , GenerateOrganizationsAccessReportCommandOutput , } from "../commands/GenerateOrganizationsAccessReportCommand" ; import { GenerateServiceLastAccessedDetailsCommandInput , GenerateServiceLastAccessedDetailsCommandOutput , } from "../commands/GenerateServiceLastAccessedDetailsCommand" ; import { GetAccessKeyLastUsedCommandInput , GetAccessKeyLastUsedCommandOutput , } from "../commands/GetAccessKeyLastUsedCommand" ; import { GetAccountAuthorizationDetailsCommandInput , GetAccountAuthorizationDetailsCommandOutput , } from "../commands/GetAccountAuthorizationDetailsCommand" ; import { GetAccountPasswordPolicyCommandInput , GetAccountPasswordPolicyCommandOutput , } from "../commands/GetAccountPasswordPolicyCommand" ; import { GetAccountSummaryCommandInput , GetAccountSummaryCommandOutput } from "../commands/GetAccountSummaryCommand" ; import { GetContextKeysForCustomPolicyCommandInput , GetContextKeysForCustomPolicyCommandOutput , } from "../commands/GetContextKeysForCustomPolicyCommand" ; import { GetContextKeysForPrincipalPolicyCommandInput , GetContextKeysForPrincipalPolicyCommandOutput , } from "../commands/GetContextKeysForPrincipalPolicyCommand" ; import { GetCredentialReportCommandInput , GetCredentialReportCommandOutput , } from "../commands/GetCredentialReportCommand" ; import { GetGroupCommandInput , GetGroupCommandOutput } from "../commands/GetGroupCommand" ; import { GetGroupPolicyCommandInput , GetGroupPolicyCommandOutput } from "../commands/GetGroupPolicyCommand" ; import { GetInstanceProfileCommandInput , GetInstanceProfileCommandOutput } from "../commands/GetInstanceProfileCommand" ; import { GetLoginProfileCommandInput , GetLoginProfileCommandOutput } from "../commands/GetLoginProfileCommand" ; import { GetOpenIDConnectProviderCommandInput , GetOpenIDConnectProviderCommandOutput , } from "../commands/GetOpenIDConnectProviderCommand" ; import { GetOrganizationsAccessReportCommandInput , GetOrganizationsAccessReportCommandOutput , } from "../commands/GetOrganizationsAccessReportCommand" ; import { GetPolicyCommandInput , GetPolicyCommandOutput } from "../commands/GetPolicyCommand" ; import { GetPolicyVersionCommandInput , GetPolicyVersionCommandOutput } from "../commands/GetPolicyVersionCommand" ; import { GetRoleCommandInput , GetRoleCommandOutput } from "../commands/GetRoleCommand" ; import { GetRolePolicyCommandInput , GetRolePolicyCommandOutput } from "../commands/GetRolePolicyCommand" ; import { GetSAMLProviderCommandInput , GetSAMLProviderCommandOutput } from "../commands/GetSAMLProviderCommand" ; import { GetServerCertificateCommandInput , GetServerCertificateCommandOutput , } from "../commands/GetServerCertificateCommand" ; import { GetServiceLastAccessedDetailsCommandInput , GetServiceLastAccessedDetailsCommandOutput , } from "../commands/GetServiceLastAccessedDetailsCommand" ; import { GetServiceLastAccessedDetailsWithEntitiesCommandInput , GetServiceLastAccessedDetailsWithEntitiesCommandOutput , } from "../commands/GetServiceLastAccessedDetailsWithEntitiesCommand" ; import { GetServiceLinkedRoleDeletionStatusCommandInput , GetServiceLinkedRoleDeletionStatusCommandOutput , } from "../commands/GetServiceLinkedRoleDeletionStatusCommand" ; import { GetSSHPublicKeyCommandInput , GetSSHPublicKeyCommandOutput } from "../commands/GetSSHPublicKeyCommand" ; import { GetUserCommandInput , GetUserCommandOutput } from "../commands/GetUserCommand" ; import { GetUserPolicyCommandInput , GetUserPolicyCommandOutput } from "../commands/GetUserPolicyCommand" ; import { ListAccessKeysCommandInput , ListAccessKeysCommandOutput } from "../commands/ListAccessKeysCommand" ; import { ListAccountAliasesCommandInput , ListAccountAliasesCommandOutput } from "../commands/ListAccountAliasesCommand" ; import { ListAttachedGroupPoliciesCommandInput , ListAttachedGroupPoliciesCommandOutput , } from "../commands/ListAttachedGroupPoliciesCommand" ; import { ListAttachedRolePoliciesCommandInput , ListAttachedRolePoliciesCommandOutput , } from "../commands/ListAttachedRolePoliciesCommand" ; import { ListAttachedUserPoliciesCommandInput , ListAttachedUserPoliciesCommandOutput , } from "../commands/ListAttachedUserPoliciesCommand" ; import { ListEntitiesForPolicyCommandInput , ListEntitiesForPolicyCommandOutput , } from "../commands/ListEntitiesForPolicyCommand" ; import { ListGroupPoliciesCommandInput , ListGroupPoliciesCommandOutput } from "../commands/ListGroupPoliciesCommand" ; import { ListGroupsCommandInput , ListGroupsCommandOutput } from "../commands/ListGroupsCommand" ; import { ListGroupsForUserCommandInput , ListGroupsForUserCommandOutput } from "../commands/ListGroupsForUserCommand" ; import { ListInstanceProfilesCommandInput , ListInstanceProfilesCommandOutput , } from "../commands/ListInstanceProfilesCommand" ; import { ListInstanceProfilesForRoleCommandInput , ListInstanceProfilesForRoleCommandOutput , } from "../commands/ListInstanceProfilesForRoleCommand" ; import { ListInstanceProfileTagsCommandInput , ListInstanceProfileTagsCommandOutput , } from "../commands/ListInstanceProfileTagsCommand" ; import { ListMFADevicesCommandInput , ListMFADevicesCommandOutput } from "../commands/ListMFADevicesCommand" ; import { ListMFADeviceTagsCommandInput , ListMFADeviceTagsCommandOutput } from "../commands/ListMFADeviceTagsCommand" ; import { ListOpenIDConnectProvidersCommandInput , ListOpenIDConnectProvidersCommandOutput , } from "../commands/ListOpenIDConnectProvidersCommand" ; import { ListOpenIDConnectProviderTagsCommandInput , ListOpenIDConnectProviderTagsCommandOutput , } from "../commands/ListOpenIDConnectProviderTagsCommand" ; import { ListPoliciesCommandInput , ListPoliciesCommandOutput } from "../commands/ListPoliciesCommand" ; import { ListPoliciesGrantingServiceAccessCommandInput , ListPoliciesGrantingServiceAccessCommandOutput , } from "../commands/ListPoliciesGrantingServiceAccessCommand" ; import { ListPolicyTagsCommandInput , ListPolicyTagsCommandOutput } from "../commands/ListPolicyTagsCommand" ; import { ListPolicyVersionsCommandInput , ListPolicyVersionsCommandOutput } from "../commands/ListPolicyVersionsCommand" ; import { ListRolePoliciesCommandInput , ListRolePoliciesCommandOutput } from "../commands/ListRolePoliciesCommand" ; import { ListRolesCommandInput , ListRolesCommandOutput } from "../commands/ListRolesCommand" ; import { ListRoleTagsCommandInput , ListRoleTagsCommandOutput } from "../commands/ListRoleTagsCommand" ; import { ListSAMLProvidersCommandInput , ListSAMLProvidersCommandOutput } from "../commands/ListSAMLProvidersCommand" ; import { ListSAMLProviderTagsCommandInput , ListSAMLProviderTagsCommandOutput , } from "../commands/ListSAMLProviderTagsCommand" ; import { ListServerCertificatesCommandInput , ListServerCertificatesCommandOutput , } from "../commands/ListServerCertificatesCommand" ; import { ListServerCertificateTagsCommandInput , ListServerCertificateTagsCommandOutput , } from "../commands/ListServerCertificateTagsCommand" ; import { ListServiceSpecificCredentialsCommandInput , ListServiceSpecificCredentialsCommandOutput , } from "../commands/ListServiceSpecificCredentialsCommand" ; import { ListSigningCertificatesCommandInput , ListSigningCertificatesCommandOutput , } from "../commands/ListSigningCertificatesCommand" ; import { ListSSHPublicKeysCommandInput , ListSSHPublicKeysCommandOutput } from "../commands/ListSSHPublicKeysCommand" ; import { ListUserPoliciesCommandInput , ListUserPoliciesCommandOutput } from "../commands/ListUserPoliciesCommand" ; import { ListUsersCommandInput , ListUsersCommandOutput } from "../commands/ListUsersCommand" ; import { ListUserTagsCommandInput , ListUserTagsCommandOutput } from "../commands/ListUserTagsCommand" ; import { ListVirtualMFADevicesCommandInput , ListVirtualMFADevicesCommandOutput , } from "../commands/ListVirtualMFADevicesCommand" ; import { PutGroupPolicyCommandInput , PutGroupPolicyCommandOutput } from "../commands/PutGroupPolicyCommand" ; import { PutRolePermissionsBoundaryCommandInput , PutRolePermissionsBoundaryCommandOutput , } from "../commands/PutRolePermissionsBoundaryCommand" ; import { PutRolePolicyCommandInput , PutRolePolicyCommandOutput } from "../commands/PutRolePolicyCommand" ; import { PutUserPermissionsBoundaryCommandInput , PutUserPermissionsBoundaryCommandOutput , } from "../commands/PutUserPermissionsBoundaryCommand" ; import { PutUserPolicyCommandInput , PutUserPolicyCommandOutput } from "../commands/PutUserPolicyCommand" ; import { RemoveClientIDFromOpenIDConnectProviderCommandInput , RemoveClientIDFromOpenIDConnectProviderCommandOutput , } from "../commands/RemoveClientIDFromOpenIDConnectProviderCommand" ; import { RemoveRoleFromInstanceProfileCommandInput , RemoveRoleFromInstanceProfileCommandOutput , } from "../commands/RemoveRoleFromInstanceProfileCommand" ; import { RemoveUserFromGroupCommandInput , RemoveUserFromGroupCommandOutput , } from "../commands/RemoveUserFromGroupCommand" ; import { ResetServiceSpecificCredentialCommandInput , ResetServiceSpecificCredentialCommandOutput , } from "../commands/ResetServiceSpecificCredentialCommand" ; import { ResyncMFADeviceCommandInput , ResyncMFADeviceCommandOutput } from "../commands/ResyncMFADeviceCommand" ; import { SetDefaultPolicyVersionCommandInput , SetDefaultPolicyVersionCommandOutput , } from "../commands/SetDefaultPolicyVersionCommand" ; import { SetSecurityTokenServicePreferencesCommandInput , SetSecurityTokenServicePreferencesCommandOutput , } from "../commands/SetSecurityTokenServicePreferencesCommand" ; import { SimulateCustomPolicyCommandInput , SimulateCustomPolicyCommandOutput , } from "../commands/SimulateCustomPolicyCommand" ; import { SimulatePrincipalPolicyCommandInput , SimulatePrincipalPolicyCommandOutput , } from "../commands/SimulatePrincipalPolicyCommand" ; import { TagInstanceProfileCommandInput , TagInstanceProfileCommandOutput } from "../commands/TagInstanceProfileCommand" ; import { TagMFADeviceCommandInput , TagMFADeviceCommandOutput } from "../commands/TagMFADeviceCommand" ; import { TagOpenIDConnectProviderCommandInput , TagOpenIDConnectProviderCommandOutput , } from "../commands/TagOpenIDConnectProviderCommand" ; import { TagPolicyCommandInput , TagPolicyCommandOutput } from "../commands/TagPolicyCommand" ; import { TagRoleCommandInput , TagRoleCommandOutput } from "../commands/TagRoleCommand" ; import { TagSAMLProviderCommandInput , TagSAMLProviderCommandOutput } from "../commands/TagSAMLProviderCommand" ; import { TagServerCertificateCommandInput , TagServerCertificateCommandOutput , } from "../commands/TagServerCertificateCommand" ; import { TagUserCommandInput , TagUserCommandOutput } from "../commands/TagUserCommand" ; import { UntagInstanceProfileCommandInput , UntagInstanceProfileCommandOutput , } from "../commands/UntagInstanceProfileCommand" ; import { UntagMFADeviceCommandInput , UntagMFADeviceCommandOutput } from "../commands/UntagMFADeviceCommand" ; import { UntagOpenIDConnectProviderCommandInput , UntagOpenIDConnectProviderCommandOutput , } from "../commands/UntagOpenIDConnectProviderCommand" ; import { UntagPolicyCommandInput , UntagPolicyCommandOutput } from "../commands/UntagPolicyCommand" ; import { UntagRoleCommandInput , UntagRoleCommandOutput } from "../commands/UntagRoleCommand" ; import { UntagSAMLProviderCommandInput , UntagSAMLProviderCommandOutput } from "../commands/UntagSAMLProviderCommand" ; import { UntagServerCertificateCommandInput , UntagServerCertificateCommandOutput , } from "../commands/UntagServerCertificateCommand" ; import { UntagUserCommandInput , UntagUserCommandOutput } from "../commands/UntagUserCommand" ; import { UpdateAccessKeyCommandInput , UpdateAccessKeyCommandOutput } from "../commands/UpdateAccessKeyCommand" ; import { UpdateAccountPasswordPolicyCommandInput , UpdateAccountPasswordPolicyCommandOutput , } from "../commands/UpdateAccountPasswordPolicyCommand" ; import { UpdateAssumeRolePolicyCommandInput , UpdateAssumeRolePolicyCommandOutput , } from "../commands/UpdateAssumeRolePolicyCommand" ; import { UpdateGroupCommandInput , UpdateGroupCommandOutput } from "../commands/UpdateGroupCommand" ; import { UpdateLoginProfileCommandInput , UpdateLoginProfileCommandOutput } from "../commands/UpdateLoginProfileCommand" ; import { UpdateOpenIDConnectProviderThumbprintCommandInput , UpdateOpenIDConnectProviderThumbprintCommandOutput , } from "../commands/UpdateOpenIDConnectProviderThumbprintCommand" ; import { UpdateRoleCommandInput , UpdateRoleCommandOutput } from "../commands/UpdateRoleCommand" ; import { UpdateRoleDescriptionCommandInput , UpdateRoleDescriptionCommandOutput , } from "../commands/UpdateRoleDescriptionCommand" ; import { UpdateSAMLProviderCommandInput , UpdateSAMLProviderCommandOutput } from "../commands/UpdateSAMLProviderCommand" ; import { UpdateServerCertificateCommandInput , UpdateServerCertificateCommandOutput , } from "../commands/UpdateServerCertificateCommand" ; import { UpdateServiceSpecificCredentialCommandInput , UpdateServiceSpecificCredentialCommandOutput , } from "../commands/UpdateServiceSpecificCredentialCommand" ; import { UpdateSigningCertificateCommandInput , UpdateSigningCertificateCommandOutput , } from "../commands/UpdateSigningCertificateCommand" ; import { UpdateSSHPublicKeyCommandInput , UpdateSSHPublicKeyCommandOutput } from "../commands/UpdateSSHPublicKeyCommand" ; import { UpdateUserCommandInput , UpdateUserCommandOutput } from "../commands/UpdateUserCommand" ; import { UploadServerCertificateCommandInput , UploadServerCertificateCommandOutput , } from "../commands/UploadServerCertificateCommand" ; import { UploadSigningCertificateCommandInput , UploadSigningCertificateCommandOutput , } from "../commands/UploadSigningCertificateCommand" ; import { UploadSSHPublicKeyCommandInput , UploadSSHPublicKeyCommandOutput } from "../commands/UploadSSHPublicKeyCommand" ; import { AccessDetail , AccessKey , AccessKeyLastUsed , AccessKeyMetadata , AddClientIDToOpenIDConnectProviderRequest , AddRoleToInstanceProfileRequest , AddUserToGroupRequest , AttachedPermissionsBoundary , AttachedPolicy , AttachGroupPolicyRequest , AttachRolePolicyRequest , AttachUserPolicyRequest , ChangePasswordRequest , ConcurrentModificationException , ContextEntry , CreateAccessKeyRequest , CreateAccessKeyResponse , CreateAccountAliasRequest , CreateGroupRequest , CreateGroupResponse , CreateInstanceProfileRequest , CreateInstanceProfileResponse , CreateLoginProfileRequest , CreateLoginProfileResponse , CreateOpenIDConnectProviderRequest , CreateOpenIDConnectProviderResponse , CreatePolicyRequest , CreatePolicyResponse , CreatePolicyVersionRequest , CreatePolicyVersionResponse , CreateRoleRequest , CreateRoleResponse , CreateSAMLProviderRequest , CreateSAMLProviderResponse , CreateServiceLinkedRoleRequest , CreateServiceLinkedRoleResponse , CreateServiceSpecificCredentialRequest , CreateServiceSpecificCredentialResponse , CreateUserRequest , CreateUserResponse , CreateVirtualMFADeviceRequest , CreateVirtualMFADeviceResponse , CredentialReportExpiredException , CredentialReportNotPresentException , CredentialReportNotReadyException , DeactivateMFADeviceRequest , DeleteAccessKeyRequest , DeleteAccountAliasRequest , DeleteConflictException , DeleteGroupPolicyRequest , DeleteGroupRequest , DeleteInstanceProfileRequest , DeleteLoginProfileRequest , DeleteOpenIDConnectProviderRequest , DeletePolicyRequest , DeletePolicyVersionRequest , DeleteRolePermissionsBoundaryRequest , DeleteRolePolicyRequest , DeleteRoleRequest , DeleteSAMLProviderRequest , DeleteServerCertificateRequest , DeleteServiceLinkedRoleRequest , DeleteServiceLinkedRoleResponse , DeleteServiceSpecificCredentialRequest , DeleteSigningCertificateRequest , DeleteSSHPublicKeyRequest , DeleteUserPermissionsBoundaryRequest , DeleteUserPolicyRequest , DeleteUserRequest , DeleteVirtualMFADeviceRequest , DeletionTaskFailureReasonType , DetachGroupPolicyRequest , DetachRolePolicyRequest , DetachUserPolicyRequest , EnableMFADeviceRequest , EntityAlreadyExistsException , EntityDetails , EntityInfo , EntityTemporarilyUnmodifiableException , EntityType , ErrorDetails , EvaluationResult , GenerateCredentialReportResponse , GenerateOrganizationsAccessReportRequest , GenerateOrganizationsAccessReportResponse , GenerateServiceLastAccessedDetailsRequest , GenerateServiceLastAccessedDetailsResponse , GetAccessKeyLastUsedRequest , GetAccessKeyLastUsedResponse , GetAccountAuthorizationDetailsRequest , GetAccountAuthorizationDetailsResponse , GetAccountPasswordPolicyResponse , GetAccountSummaryResponse , GetContextKeysForCustomPolicyRequest , GetContextKeysForPolicyResponse , GetContextKeysForPrincipalPolicyRequest , GetCredentialReportResponse , GetGroupPolicyRequest , GetGroupPolicyResponse , GetGroupRequest , GetGroupResponse , GetInstanceProfileRequest , GetInstanceProfileResponse , GetLoginProfileRequest , GetLoginProfileResponse , GetOpenIDConnectProviderRequest , GetOpenIDConnectProviderResponse , GetOrganizationsAccessReportRequest , GetOrganizationsAccessReportResponse , GetPolicyRequest , GetPolicyResponse , GetPolicyVersionRequest , GetPolicyVersionResponse , GetRolePolicyRequest , GetRolePolicyResponse , GetRoleRequest , GetRoleResponse , GetSAMLProviderRequest , GetSAMLProviderResponse , GetServerCertificateRequest , GetServerCertificateResponse , GetServiceLastAccessedDetailsRequest , GetServiceLastAccessedDetailsResponse , GetServiceLastAccessedDetailsWithEntitiesRequest , GetServiceLastAccessedDetailsWithEntitiesResponse , GetServiceLinkedRoleDeletionStatusRequest , GetServiceLinkedRoleDeletionStatusResponse , GetSSHPublicKeyRequest , GetSSHPublicKeyResponse , GetUserPolicyRequest , GetUserPolicyResponse , GetUserRequest , GetUserResponse , Group , GroupDetail , InstanceProfile , InvalidAuthenticationCodeException , InvalidInputException , InvalidUserTypeException , LimitExceededException , ListAccessKeysRequest , ListAccessKeysResponse , ListAccountAliasesRequest , ListAccountAliasesResponse , ListAttachedGroupPoliciesRequest , ListAttachedGroupPoliciesResponse , ListAttachedRolePoliciesRequest , ListAttachedRolePoliciesResponse , ListAttachedUserPoliciesRequest , ListAttachedUserPoliciesResponse , ListEntitiesForPolicyRequest , ListEntitiesForPolicyResponse , ListGroupPoliciesRequest , ListGroupPoliciesResponse , ListGroupsForUserRequest , ListGroupsForUserResponse , ListGroupsRequest , ListGroupsResponse , ListInstanceProfilesForRoleRequest , ListInstanceProfilesForRoleResponse , ListInstanceProfilesRequest , ListInstanceProfilesResponse , ListInstanceProfileTagsRequest , ListInstanceProfileTagsResponse , ListMFADevicesRequest , ListMFADevicesResponse , ListMFADeviceTagsRequest , ListMFADeviceTagsResponse , ListOpenIDConnectProvidersRequest , ListOpenIDConnectProvidersResponse , ListOpenIDConnectProviderTagsRequest , ListOpenIDConnectProviderTagsResponse , ListPoliciesGrantingServiceAccessEntry , ListPoliciesGrantingServiceAccessRequest , ListPoliciesGrantingServiceAccessResponse , ListPoliciesRequest , ListPoliciesResponse , ListPolicyTagsRequest , ListPolicyTagsResponse , ListPolicyVersionsRequest , ListPolicyVersionsResponse , ListRolePoliciesRequest , ListRolePoliciesResponse , ListRolesRequest , ListRolesResponse , ListRoleTagsRequest , ListRoleTagsResponse , ListSAMLProvidersRequest , ListSAMLProvidersResponse , ListSAMLProviderTagsRequest , ListSAMLProviderTagsResponse , ListServerCertificatesRequest , ListServerCertificatesResponse , ListServerCertificateTagsRequest , ListServerCertificateTagsResponse , ListServiceSpecificCredentialsRequest , ListServiceSpecificCredentialsResponse , ListSigningCertificatesRequest , ListSigningCertificatesResponse , ListSSHPublicKeysRequest , ListSSHPublicKeysResponse , ListUserPoliciesRequest , ListUserPoliciesResponse , ListUsersRequest , ListUsersResponse , ListUserTagsRequest , ListUserTagsResponse , ListVirtualMFADevicesRequest , ListVirtualMFADevicesResponse , LoginProfile , MalformedPolicyDocumentException , ManagedPolicyDetail , MFADevice , NoSuchEntityException , OpenIDConnectProviderListEntry , OrganizationsDecisionDetail , PasswordPolicy , PasswordPolicyViolationException , PermissionsBoundaryDecisionDetail , Policy , PolicyDetail , PolicyEvaluationDecisionType , PolicyEvaluationException , PolicyGrantingServiceAccess , PolicyGroup , PolicyNotAttachableException , PolicyRole , PolicyUser , PolicyVersion , Position , PutGroupPolicyRequest , PutRolePermissionsBoundaryRequest , PutRolePolicyRequest , PutUserPermissionsBoundaryRequest , PutUserPolicyRequest , RemoveClientIDFromOpenIDConnectProviderRequest , RemoveRoleFromInstanceProfileRequest , RemoveUserFromGroupRequest , ReportGenerationLimitExceededException , ResetServiceSpecificCredentialRequest , ResetServiceSpecificCredentialResponse , ResourceSpecificResult , ResyncMFADeviceRequest , Role , RoleDetail , RoleLastUsed , RoleUsageType , SAMLProviderListEntry , ServerCertificate , ServerCertificateMetadata , ServiceFailureException , ServiceLastAccessed , ServiceNotSupportedException , ServiceSpecificCredential , ServiceSpecificCredentialMetadata , SetDefaultPolicyVersionRequest , SetSecurityTokenServicePreferencesRequest , SigningCertificate , SimulateCustomPolicyRequest , SimulatePolicyResponse , SimulatePrincipalPolicyRequest , SSHPublicKey , SSHPublicKeyMetadata , Statement , Tag , TagInstanceProfileRequest , TagMFADeviceRequest , TagOpenIDConnectProviderRequest , TagPolicyRequest , TagRoleRequest , TagSAMLProviderRequest , TagServerCertificateRequest , TagUserRequest , TrackedActionLastAccessed , UnmodifiableEntityException , UnrecognizedPublicKeyEncodingException , UntagInstanceProfileRequest , UntagMFADeviceRequest , UntagOpenIDConnectProviderRequest , User , UserDetail , VirtualMFADevice , } from "../models/models_0" ; import { DuplicateCertificateException , DuplicateSSHPublicKeyException , InvalidCertificateException , InvalidPublicKeyException , KeyPairMismatchException , MalformedCertificateException , UntagPolicyRequest , UntagRoleRequest , UntagSAMLProviderRequest , UntagServerCertificateRequest , UntagUserRequest , UpdateAccessKeyRequest , UpdateAccountPasswordPolicyRequest , UpdateAssumeRolePolicyRequest , UpdateGroupRequest , UpdateLoginProfileRequest , UpdateOpenIDConnectProviderThumbprintRequest , UpdateRoleDescriptionRequest , UpdateRoleDescriptionResponse , UpdateRoleRequest , UpdateRoleResponse , UpdateSAMLProviderRequest , UpdateSAMLProviderResponse , UpdateServerCertificateRequest , UpdateServiceSpecificCredentialRequest , UpdateSigningCertificateRequest , UpdateSSHPublicKeyRequest , UpdateUserRequest , UploadServerCertificateRequest , UploadServerCertificateResponse , UploadSigningCertificateRequest , UploadSigningCertificateResponse , UploadSSHPublicKeyRequest , UploadSSHPublicKeyResponse , } from "../models/models_1" ; export const serializeAws_queryAddClientIDToOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAddClientIDToOpenIDConnectProviderRequest ( input , context ) , Action : "AddClientIDToOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAddRoleToInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAddRoleToInstanceProfileRequest ( input , context ) , Action : "AddRoleToInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAddUserToGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAddUserToGroupRequest ( input , context ) , Action : "AddUserToGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAttachGroupPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAttachGroupPolicyRequest ( input , context ) , Action : "AttachGroupPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAttachRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAttachRolePolicyRequest ( input , context ) , Action : "AttachRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryAttachUserPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryAttachUserPolicyRequest ( input , context ) , Action : "AttachUserPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryChangePasswordCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryChangePasswordRequest ( input , context ) , Action : "ChangePassword" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateAccessKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateAccessKeyRequest ( input , context ) , Action : "CreateAccessKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateAccountAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateAccountAliasRequest ( input , context ) , Action : "CreateAccountAlias" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateGroupRequest ( input , context ) , Action : "CreateGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateInstanceProfileRequest ( input , context ) , Action : "CreateInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateLoginProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateLoginProfileRequest ( input , context ) , Action : "CreateLoginProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateOpenIDConnectProviderRequest ( input , context ) , Action : "CreateOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreatePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreatePolicyRequest ( input , context ) , Action : "CreatePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreatePolicyVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreatePolicyVersionRequest ( input , context ) , Action : "CreatePolicyVersion" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateRoleRequest ( input , context ) , Action : "CreateRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateSAMLProviderRequest ( input , context ) , Action : "CreateSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateServiceLinkedRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateServiceLinkedRoleRequest ( input , context ) , Action : "CreateServiceLinkedRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateServiceSpecificCredentialCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateServiceSpecificCredentialRequest ( input , context ) , Action : "CreateServiceSpecificCredential" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateUserRequest ( input , context ) , Action : "CreateUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryCreateVirtualMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryCreateVirtualMFADeviceRequest ( input , context ) , Action : "CreateVirtualMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeactivateMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeactivateMFADeviceRequest ( input , context ) , Action : "DeactivateMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteAccessKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteAccessKeyRequest ( input , context ) , Action : "DeleteAccessKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteAccountAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteAccountAliasRequest ( input , context ) , Action : "DeleteAccountAlias" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteAccountPasswordPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "DeleteAccountPasswordPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteGroupRequest ( input , context ) , Action : "DeleteGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteGroupPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteGroupPolicyRequest ( input , context ) , Action : "DeleteGroupPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteInstanceProfileRequest ( input , context ) , Action : "DeleteInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteLoginProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteLoginProfileRequest ( input , context ) , Action : "DeleteLoginProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteOpenIDConnectProviderRequest ( input , context ) , Action : "DeleteOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeletePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeletePolicyRequest ( input , context ) , Action : "DeletePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeletePolicyVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeletePolicyVersionRequest ( input , context ) , Action : "DeletePolicyVersion" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteRoleRequest ( input , context ) , Action : "DeleteRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteRolePermissionsBoundaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteRolePermissionsBoundaryRequest ( input , context ) , Action : "DeleteRolePermissionsBoundary" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteRolePolicyRequest ( input , context ) , Action : "DeleteRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteSAMLProviderRequest ( input , context ) , Action : "DeleteSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteServerCertificateRequest ( input , context ) , Action : "DeleteServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteServiceLinkedRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteServiceLinkedRoleRequest ( input , context ) , Action : "DeleteServiceLinkedRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteServiceSpecificCredentialCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteServiceSpecificCredentialRequest ( input , context ) , Action : "DeleteServiceSpecificCredential" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteSigningCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteSigningCertificateRequest ( input , context ) , Action : "DeleteSigningCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteSSHPublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteSSHPublicKeyRequest ( input , context ) , Action : "DeleteSSHPublicKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteUserRequest ( input , context ) , Action : "DeleteUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteUserPermissionsBoundaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteUserPermissionsBoundaryRequest ( input , context ) , Action : "DeleteUserPermissionsBoundary" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteUserPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteUserPolicyRequest ( input , context ) , Action : "DeleteUserPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDeleteVirtualMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDeleteVirtualMFADeviceRequest ( input , context ) , Action : "DeleteVirtualMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDetachGroupPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDetachGroupPolicyRequest ( input , context ) , Action : "DetachGroupPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDetachRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDetachRolePolicyRequest ( input , context ) , Action : "DetachRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryDetachUserPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryDetachUserPolicyRequest ( input , context ) , Action : "DetachUserPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryEnableMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryEnableMFADeviceRequest ( input , context ) , Action : "EnableMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGenerateCredentialReportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "GenerateCredentialReport" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGenerateOrganizationsAccessReportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGenerateOrganizationsAccessReportRequest ( input , context ) , Action : "GenerateOrganizationsAccessReport" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGenerateServiceLastAccessedDetailsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGenerateServiceLastAccessedDetailsRequest ( input , context ) , Action : "GenerateServiceLastAccessedDetails" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetAccessKeyLastUsedCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetAccessKeyLastUsedRequest ( input , context ) , Action : "GetAccessKeyLastUsed" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetAccountAuthorizationDetailsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetAccountAuthorizationDetailsRequest ( input , context ) , Action : "GetAccountAuthorizationDetails" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetAccountPasswordPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "GetAccountPasswordPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetAccountSummaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "GetAccountSummary" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetContextKeysForCustomPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetContextKeysForCustomPolicyRequest ( input , context ) , Action : "GetContextKeysForCustomPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetContextKeysForPrincipalPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetContextKeysForPrincipalPolicyRequest ( input , context ) , Action : "GetContextKeysForPrincipalPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetCredentialReportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; const body = buildFormUrlencodedString ( { Action : "GetCredentialReport" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetGroupRequest ( input , context ) , Action : "GetGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetGroupPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetGroupPolicyRequest ( input , context ) , Action : "GetGroupPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetInstanceProfileRequest ( input , context ) , Action : "GetInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetLoginProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetLoginProfileRequest ( input , context ) , Action : "GetLoginProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetOpenIDConnectProviderRequest ( input , context ) , Action : "GetOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetOrganizationsAccessReportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetOrganizationsAccessReportRequest ( input , context ) , Action : "GetOrganizationsAccessReport" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetPolicyRequest ( input , context ) , Action : "GetPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetPolicyVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetPolicyVersionRequest ( input , context ) , Action : "GetPolicyVersion" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetRoleRequest ( input , context ) , Action : "GetRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetRolePolicyRequest ( input , context ) , Action : "GetRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetSAMLProviderRequest ( input , context ) , Action : "GetSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetServerCertificateRequest ( input , context ) , Action : "GetServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetServiceLastAccessedDetailsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetServiceLastAccessedDetailsRequest ( input , context ) , Action : "GetServiceLastAccessedDetails" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesRequest ( input , context ) , Action : "GetServiceLastAccessedDetailsWithEntities" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetServiceLinkedRoleDeletionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetServiceLinkedRoleDeletionStatusRequest ( input , context ) , Action : "GetServiceLinkedRoleDeletionStatus" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetSSHPublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetSSHPublicKeyRequest ( input , context ) , Action : "GetSSHPublicKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetUserRequest ( input , context ) , Action : "GetUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryGetUserPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryGetUserPolicyRequest ( input , context ) , Action : "GetUserPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAccessKeysCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListAccessKeysRequest ( input , context ) , Action : "ListAccessKeys" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAccountAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListAccountAliasesRequest ( input , context ) , Action : "ListAccountAliases" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAttachedGroupPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListAttachedGroupPoliciesRequest ( input , context ) , Action : "ListAttachedGroupPolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAttachedRolePoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListAttachedRolePoliciesRequest ( input , context ) , Action : "ListAttachedRolePolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListAttachedUserPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListAttachedUserPoliciesRequest ( input , context ) , Action : "ListAttachedUserPolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListEntitiesForPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListEntitiesForPolicyRequest ( input , context ) , Action : "ListEntitiesForPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListGroupPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListGroupPoliciesRequest ( input , context ) , Action : "ListGroupPolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListGroupsRequest ( input , context ) , Action : "ListGroups" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListGroupsForUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListGroupsForUserRequest ( input , context ) , Action : "ListGroupsForUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListInstanceProfilesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListInstanceProfilesRequest ( input , context ) , Action : "ListInstanceProfiles" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListInstanceProfilesForRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListInstanceProfilesForRoleRequest ( input , context ) , Action : "ListInstanceProfilesForRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListInstanceProfileTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListInstanceProfileTagsRequest ( input , context ) , Action : "ListInstanceProfileTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListMFADevicesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListMFADevicesRequest ( input , context ) , Action : "ListMFADevices" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListMFADeviceTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListMFADeviceTagsRequest ( input , context ) , Action : "ListMFADeviceTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListOpenIDConnectProvidersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListOpenIDConnectProvidersRequest ( input , context ) , Action : "ListOpenIDConnectProviders" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListOpenIDConnectProviderTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListOpenIDConnectProviderTagsRequest ( input , context ) , Action : "ListOpenIDConnectProviderTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPoliciesRequest ( input , context ) , Action : "ListPolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPoliciesGrantingServiceAccessCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPoliciesGrantingServiceAccessRequest ( input , context ) , Action : "ListPoliciesGrantingServiceAccess" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPolicyTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPolicyTagsRequest ( input , context ) , Action : "ListPolicyTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListPolicyVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListPolicyVersionsRequest ( input , context ) , Action : "ListPolicyVersions" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListRolePoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListRolePoliciesRequest ( input , context ) , Action : "ListRolePolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListRolesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListRolesRequest ( input , context ) , Action : "ListRoles" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListRoleTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListRoleTagsRequest ( input , context ) , Action : "ListRoleTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListSAMLProvidersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListSAMLProvidersRequest ( input , context ) , Action : "ListSAMLProviders" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListSAMLProviderTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListSAMLProviderTagsRequest ( input , context ) , Action : "ListSAMLProviderTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListServerCertificatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListServerCertificatesRequest ( input , context ) , Action : "ListServerCertificates" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListServerCertificateTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListServerCertificateTagsRequest ( input , context ) , Action : "ListServerCertificateTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListServiceSpecificCredentialsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListServiceSpecificCredentialsRequest ( input , context ) , Action : "ListServiceSpecificCredentials" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListSigningCertificatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListSigningCertificatesRequest ( input , context ) , Action : "ListSigningCertificates" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListSSHPublicKeysCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListSSHPublicKeysRequest ( input , context ) , Action : "ListSSHPublicKeys" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListUserPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListUserPoliciesRequest ( input , context ) , Action : "ListUserPolicies" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListUsersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListUsersRequest ( input , context ) , Action : "ListUsers" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListUserTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListUserTagsRequest ( input , context ) , Action : "ListUserTags" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryListVirtualMFADevicesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryListVirtualMFADevicesRequest ( input , context ) , Action : "ListVirtualMFADevices" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryPutGroupPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryPutGroupPolicyRequest ( input , context ) , Action : "PutGroupPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryPutRolePermissionsBoundaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryPutRolePermissionsBoundaryRequest ( input , context ) , Action : "PutRolePermissionsBoundary" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryPutRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryPutRolePolicyRequest ( input , context ) , Action : "PutRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryPutUserPermissionsBoundaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryPutUserPermissionsBoundaryRequest ( input , context ) , Action : "PutUserPermissionsBoundary" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryPutUserPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryPutUserPolicyRequest ( input , context ) , Action : "PutUserPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRemoveClientIDFromOpenIDConnectProviderRequest ( input , context ) , Action : "RemoveClientIDFromOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRemoveRoleFromInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRemoveRoleFromInstanceProfileRequest ( input , context ) , Action : "RemoveRoleFromInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryRemoveUserFromGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryRemoveUserFromGroupRequest ( input , context ) , Action : "RemoveUserFromGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryResetServiceSpecificCredentialCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryResetServiceSpecificCredentialRequest ( input , context ) , Action : "ResetServiceSpecificCredential" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryResyncMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryResyncMFADeviceRequest ( input , context ) , Action : "ResyncMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_querySetDefaultPolicyVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_querySetDefaultPolicyVersionRequest ( input , context ) , Action : "SetDefaultPolicyVersion" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_querySetSecurityTokenServicePreferencesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_querySetSecurityTokenServicePreferencesRequest ( input , context ) , Action : "SetSecurityTokenServicePreferences" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_querySimulateCustomPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_querySimulateCustomPolicyRequest ( input , context ) , Action : "SimulateCustomPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_querySimulatePrincipalPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_querySimulatePrincipalPolicyRequest ( input , context ) , Action : "SimulatePrincipalPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagInstanceProfileRequest ( input , context ) , Action : "TagInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagMFADeviceRequest ( input , context ) , Action : "TagMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagOpenIDConnectProviderRequest ( input , context ) , Action : "TagOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagPolicyRequest ( input , context ) , Action : "TagPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagRoleRequest ( input , context ) , Action : "TagRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagSAMLProviderRequest ( input , context ) , Action : "TagSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagServerCertificateRequest ( input , context ) , Action : "TagServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryTagUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryTagUserRequest ( input , context ) , Action : "TagUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagInstanceProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagInstanceProfileRequest ( input , context ) , Action : "UntagInstanceProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagMFADeviceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagMFADeviceRequest ( input , context ) , Action : "UntagMFADevice" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagOpenIDConnectProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagOpenIDConnectProviderRequest ( input , context ) , Action : "UntagOpenIDConnectProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagPolicyRequest ( input , context ) , Action : "UntagPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagRoleRequest ( input , context ) , Action : "UntagRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagSAMLProviderRequest ( input , context ) , Action : "UntagSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagServerCertificateRequest ( input , context ) , Action : "UntagServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUntagUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUntagUserRequest ( input , context ) , Action : "UntagUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateAccessKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateAccessKeyRequest ( input , context ) , Action : "UpdateAccessKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateAccountPasswordPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateAccountPasswordPolicyRequest ( input , context ) , Action : "UpdateAccountPasswordPolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateAssumeRolePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateAssumeRolePolicyRequest ( input , context ) , Action : "UpdateAssumeRolePolicy" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateGroupRequest ( input , context ) , Action : "UpdateGroup" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateLoginProfileCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateLoginProfileRequest ( input , context ) , Action : "UpdateLoginProfile" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateOpenIDConnectProviderThumbprintRequest ( input , context ) , Action : "UpdateOpenIDConnectProviderThumbprint" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateRoleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateRoleRequest ( input , context ) , Action : "UpdateRole" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateRoleDescriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateRoleDescriptionRequest ( input , context ) , Action : "UpdateRoleDescription" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateSAMLProviderCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateSAMLProviderRequest ( input , context ) , Action : "UpdateSAMLProvider" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateServerCertificateRequest ( input , context ) , Action : "UpdateServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateServiceSpecificCredentialCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateServiceSpecificCredentialRequest ( input , context ) , Action : "UpdateServiceSpecificCredential" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateSigningCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateSigningCertificateRequest ( input , context ) , Action : "UpdateSigningCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateSSHPublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateSSHPublicKeyRequest ( input , context ) , Action : "UpdateSSHPublicKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUpdateUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUpdateUserRequest ( input , context ) , Action : "UpdateUser" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUploadServerCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUploadServerCertificateRequest ( input , context ) , Action : "UploadServerCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUploadSigningCertificateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUploadSigningCertificateRequest ( input , context ) , Action : "UploadSigningCertificate" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_queryUploadSSHPublicKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-www-form-urlencoded" , } ; let body ; body = buildFormUrlencodedString ( { ... serializeAws_queryUploadSSHPublicKeyRequest ( input , context ) , Action : "UploadSSHPublicKey" , Version : "2010-05-08" , } ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_queryAddClientIDToOpenIDConnectProviderCommand = async ( output , context ) : Promise < AddClientIDToOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAddClientIDToOpenIDConnectProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAddClientIDToOpenIDConnectProviderCommandError = async ( output , context ) : Promise < AddClientIDToOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAddRoleToInstanceProfileCommand = async ( output , context ) : Promise < AddRoleToInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAddRoleToInstanceProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAddRoleToInstanceProfileCommandError = async ( output , context ) : Promise < AddRoleToInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAddUserToGroupCommand = async ( output , context ) : Promise < AddUserToGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAddUserToGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAddUserToGroupCommandError = async ( output , context ) : Promise < AddUserToGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAttachGroupPolicyCommand = async ( output , context ) : Promise < AttachGroupPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAttachGroupPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAttachGroupPolicyCommandError = async ( output , context ) : Promise < AttachGroupPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyNotAttachableException" : case "com.amazonaws.iam#PolicyNotAttachableException" : response = { ... ( await deserializeAws_queryPolicyNotAttachableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAttachRolePolicyCommand = async ( output , context ) : Promise < AttachRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAttachRolePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAttachRolePolicyCommandError = async ( output , context ) : Promise < AttachRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyNotAttachableException" : case "com.amazonaws.iam#PolicyNotAttachableException" : response = { ... ( await deserializeAws_queryPolicyNotAttachableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryAttachUserPolicyCommand = async ( output , context ) : Promise < AttachUserPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryAttachUserPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryAttachUserPolicyCommandError = async ( output , context ) : Promise < AttachUserPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyNotAttachableException" : case "com.amazonaws.iam#PolicyNotAttachableException" : response = { ... ( await deserializeAws_queryPolicyNotAttachableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryChangePasswordCommand = async ( output , context ) : Promise < ChangePasswordCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryChangePasswordCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryChangePasswordCommandError = async ( output , context ) : Promise < ChangePasswordCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidUserTypeException" : case "com.amazonaws.iam#InvalidUserTypeException" : response = { ... ( await deserializeAws_queryInvalidUserTypeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordPolicyViolationException" : case "com.amazonaws.iam#PasswordPolicyViolationException" : response = { ... ( await deserializeAws_queryPasswordPolicyViolationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateAccessKeyCommand = async ( output , context ) : Promise < CreateAccessKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateAccessKeyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateAccessKeyResponse ( data . CreateAccessKeyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateAccessKeyCommandError = async ( output , context ) : Promise < CreateAccessKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateAccountAliasCommand = async ( output , context ) : Promise < CreateAccountAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateAccountAliasCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateAccountAliasCommandError = async ( output , context ) : Promise < CreateAccountAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateGroupCommand = async ( output , context ) : Promise < CreateGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateGroupResponse ( data . CreateGroupResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateGroupCommandError = async ( output , context ) : Promise < CreateGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateInstanceProfileCommand = async ( output , context ) : Promise < CreateInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateInstanceProfileCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateInstanceProfileResponse ( data . CreateInstanceProfileResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateInstanceProfileCommandError = async ( output , context ) : Promise < CreateInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateLoginProfileCommand = async ( output , context ) : Promise < CreateLoginProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateLoginProfileCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateLoginProfileResponse ( data . CreateLoginProfileResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateLoginProfileCommandError = async ( output , context ) : Promise < CreateLoginProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordPolicyViolationException" : case "com.amazonaws.iam#PasswordPolicyViolationException" : response = { ... ( await deserializeAws_queryPasswordPolicyViolationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateOpenIDConnectProviderCommand = async ( output , context ) : Promise < CreateOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateOpenIDConnectProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateOpenIDConnectProviderResponse ( data . CreateOpenIDConnectProviderResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateOpenIDConnectProviderCommandError = async ( output , context ) : Promise < CreateOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreatePolicyCommand = async ( output , context ) : Promise < CreatePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreatePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreatePolicyResponse ( data . CreatePolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreatePolicyCommandError = async ( output , context ) : Promise < CreatePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreatePolicyVersionCommand = async ( output , context ) : Promise < CreatePolicyVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreatePolicyVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreatePolicyVersionResponse ( data . CreatePolicyVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreatePolicyVersionCommandError = async ( output , context ) : Promise < CreatePolicyVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateRoleCommand = async ( output , context ) : Promise < CreateRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateRoleResponse ( data . CreateRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateRoleCommandError = async ( output , context ) : Promise < CreateRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateSAMLProviderCommand = async ( output , context ) : Promise < CreateSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateSAMLProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateSAMLProviderResponse ( data . CreateSAMLProviderResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateSAMLProviderCommandError = async ( output , context ) : Promise < CreateSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateServiceLinkedRoleCommand = async ( output , context ) : Promise < CreateServiceLinkedRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateServiceLinkedRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateServiceLinkedRoleResponse ( data . CreateServiceLinkedRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateServiceLinkedRoleCommandError = async ( output , context ) : Promise < CreateServiceLinkedRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateServiceSpecificCredentialCommand = async ( output , context ) : Promise < CreateServiceSpecificCredentialCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateServiceSpecificCredentialCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateServiceSpecificCredentialResponse ( data . CreateServiceSpecificCredentialResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateServiceSpecificCredentialCommandError = async ( output , context ) : Promise < CreateServiceSpecificCredentialCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceNotSupportedException" : case "com.amazonaws.iam#ServiceNotSupportedException" : response = { ... ( await deserializeAws_queryServiceNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateUserCommand = async ( output , context ) : Promise < CreateUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateUserResponse ( data . CreateUserResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateUserCommandError = async ( output , context ) : Promise < CreateUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryCreateVirtualMFADeviceCommand = async ( output , context ) : Promise < CreateVirtualMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryCreateVirtualMFADeviceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryCreateVirtualMFADeviceResponse ( data . CreateVirtualMFADeviceResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryCreateVirtualMFADeviceCommandError = async ( output , context ) : Promise < CreateVirtualMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeactivateMFADeviceCommand = async ( output , context ) : Promise < DeactivateMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeactivateMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeactivateMFADeviceCommandError = async ( output , context ) : Promise < DeactivateMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteAccessKeyCommand = async ( output , context ) : Promise < DeleteAccessKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteAccessKeyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteAccessKeyCommandError = async ( output , context ) : Promise < DeleteAccessKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteAccountAliasCommand = async ( output , context ) : Promise < DeleteAccountAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteAccountAliasCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteAccountAliasCommandError = async ( output , context ) : Promise < DeleteAccountAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteAccountPasswordPolicyCommand = async ( output , context ) : Promise < DeleteAccountPasswordPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteAccountPasswordPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteAccountPasswordPolicyCommandError = async ( output , context ) : Promise < DeleteAccountPasswordPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteGroupCommand = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteGroupCommandError = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteGroupPolicyCommand = async ( output , context ) : Promise < DeleteGroupPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteGroupPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteGroupPolicyCommandError = async ( output , context ) : Promise < DeleteGroupPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteInstanceProfileCommand = async ( output , context ) : Promise < DeleteInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteInstanceProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteInstanceProfileCommandError = async ( output , context ) : Promise < DeleteInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteLoginProfileCommand = async ( output , context ) : Promise < DeleteLoginProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteLoginProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteLoginProfileCommandError = async ( output , context ) : Promise < DeleteLoginProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteOpenIDConnectProviderCommand = async ( output , context ) : Promise < DeleteOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteOpenIDConnectProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteOpenIDConnectProviderCommandError = async ( output , context ) : Promise < DeleteOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeletePolicyCommand = async ( output , context ) : Promise < DeletePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeletePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeletePolicyCommandError = async ( output , context ) : Promise < DeletePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeletePolicyVersionCommand = async ( output , context ) : Promise < DeletePolicyVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeletePolicyVersionCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeletePolicyVersionCommandError = async ( output , context ) : Promise < DeletePolicyVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteRoleCommand = async ( output , context ) : Promise < DeleteRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteRoleCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteRoleCommandError = async ( output , context ) : Promise < DeleteRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteRolePermissionsBoundaryCommand = async ( output , context ) : Promise < DeleteRolePermissionsBoundaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteRolePermissionsBoundaryCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteRolePermissionsBoundaryCommandError = async ( output , context ) : Promise < DeleteRolePermissionsBoundaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteRolePolicyCommand = async ( output , context ) : Promise < DeleteRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteRolePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteRolePolicyCommandError = async ( output , context ) : Promise < DeleteRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteSAMLProviderCommand = async ( output , context ) : Promise < DeleteSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteSAMLProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteSAMLProviderCommandError = async ( output , context ) : Promise < DeleteSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteServerCertificateCommand = async ( output , context ) : Promise < DeleteServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteServerCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteServerCertificateCommandError = async ( output , context ) : Promise < DeleteServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteServiceLinkedRoleCommand = async ( output , context ) : Promise < DeleteServiceLinkedRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteServiceLinkedRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryDeleteServiceLinkedRoleResponse ( data . DeleteServiceLinkedRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteServiceLinkedRoleCommandError = async ( output , context ) : Promise < DeleteServiceLinkedRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteServiceSpecificCredentialCommand = async ( output , context ) : Promise < DeleteServiceSpecificCredentialCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteServiceSpecificCredentialCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteServiceSpecificCredentialCommandError = async ( output , context ) : Promise < DeleteServiceSpecificCredentialCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteSigningCertificateCommand = async ( output , context ) : Promise < DeleteSigningCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteSigningCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteSigningCertificateCommandError = async ( output , context ) : Promise < DeleteSigningCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteSSHPublicKeyCommand = async ( output , context ) : Promise < DeleteSSHPublicKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteSSHPublicKeyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteSSHPublicKeyCommandError = async ( output , context ) : Promise < DeleteSSHPublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteUserCommand = async ( output , context ) : Promise < DeleteUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteUserCommandError = async ( output , context ) : Promise < DeleteUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteUserPermissionsBoundaryCommand = async ( output , context ) : Promise < DeleteUserPermissionsBoundaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteUserPermissionsBoundaryCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteUserPermissionsBoundaryCommandError = async ( output , context ) : Promise < DeleteUserPermissionsBoundaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteUserPolicyCommand = async ( output , context ) : Promise < DeleteUserPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteUserPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteUserPolicyCommandError = async ( output , context ) : Promise < DeleteUserPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDeleteVirtualMFADeviceCommand = async ( output , context ) : Promise < DeleteVirtualMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDeleteVirtualMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDeleteVirtualMFADeviceCommandError = async ( output , context ) : Promise < DeleteVirtualMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DeleteConflictException" : case "com.amazonaws.iam#DeleteConflictException" : response = { ... ( await deserializeAws_queryDeleteConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDetachGroupPolicyCommand = async ( output , context ) : Promise < DetachGroupPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDetachGroupPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDetachGroupPolicyCommandError = async ( output , context ) : Promise < DetachGroupPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDetachRolePolicyCommand = async ( output , context ) : Promise < DetachRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDetachRolePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDetachRolePolicyCommandError = async ( output , context ) : Promise < DetachRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryDetachUserPolicyCommand = async ( output , context ) : Promise < DetachUserPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryDetachUserPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryDetachUserPolicyCommandError = async ( output , context ) : Promise < DetachUserPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryEnableMFADeviceCommand = async ( output , context ) : Promise < EnableMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryEnableMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryEnableMFADeviceCommandError = async ( output , context ) : Promise < EnableMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidAuthenticationCodeException" : case "com.amazonaws.iam#InvalidAuthenticationCodeException" : response = { ... ( await deserializeAws_queryInvalidAuthenticationCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGenerateCredentialReportCommand = async ( output , context ) : Promise < GenerateCredentialReportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGenerateCredentialReportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGenerateCredentialReportResponse ( data . GenerateCredentialReportResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGenerateCredentialReportCommandError = async ( output , context ) : Promise < GenerateCredentialReportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGenerateOrganizationsAccessReportCommand = async ( output , context ) : Promise < GenerateOrganizationsAccessReportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGenerateOrganizationsAccessReportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGenerateOrganizationsAccessReportResponse ( data . GenerateOrganizationsAccessReportResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGenerateOrganizationsAccessReportCommandError = async ( output , context ) : Promise < GenerateOrganizationsAccessReportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ReportGenerationLimitExceededException" : case "com.amazonaws.iam#ReportGenerationLimitExceededException" : response = { ... ( await deserializeAws_queryReportGenerationLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGenerateServiceLastAccessedDetailsCommand = async ( output , context ) : Promise < GenerateServiceLastAccessedDetailsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGenerateServiceLastAccessedDetailsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGenerateServiceLastAccessedDetailsResponse ( data . GenerateServiceLastAccessedDetailsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGenerateServiceLastAccessedDetailsCommandError = async ( output , context ) : Promise < GenerateServiceLastAccessedDetailsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetAccessKeyLastUsedCommand = async ( output , context ) : Promise < GetAccessKeyLastUsedCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetAccessKeyLastUsedCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetAccessKeyLastUsedResponse ( data . GetAccessKeyLastUsedResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetAccessKeyLastUsedCommandError = async ( output , context ) : Promise < GetAccessKeyLastUsedCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetAccountAuthorizationDetailsCommand = async ( output , context ) : Promise < GetAccountAuthorizationDetailsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetAccountAuthorizationDetailsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetAccountAuthorizationDetailsResponse ( data . GetAccountAuthorizationDetailsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetAccountAuthorizationDetailsCommandError = async ( output , context ) : Promise < GetAccountAuthorizationDetailsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetAccountPasswordPolicyCommand = async ( output , context ) : Promise < GetAccountPasswordPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetAccountPasswordPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetAccountPasswordPolicyResponse ( data . GetAccountPasswordPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetAccountPasswordPolicyCommandError = async ( output , context ) : Promise < GetAccountPasswordPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetAccountSummaryCommand = async ( output , context ) : Promise < GetAccountSummaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetAccountSummaryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetAccountSummaryResponse ( data . GetAccountSummaryResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetAccountSummaryCommandError = async ( output , context ) : Promise < GetAccountSummaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetContextKeysForCustomPolicyCommand = async ( output , context ) : Promise < GetContextKeysForCustomPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetContextKeysForCustomPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetContextKeysForPolicyResponse ( data . GetContextKeysForCustomPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetContextKeysForCustomPolicyCommandError = async ( output , context ) : Promise < GetContextKeysForCustomPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetContextKeysForPrincipalPolicyCommand = async ( output , context ) : Promise < GetContextKeysForPrincipalPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetContextKeysForPrincipalPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetContextKeysForPolicyResponse ( data . GetContextKeysForPrincipalPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetContextKeysForPrincipalPolicyCommandError = async ( output , context ) : Promise < GetContextKeysForPrincipalPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetCredentialReportCommand = async ( output , context ) : Promise < GetCredentialReportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetCredentialReportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetCredentialReportResponse ( data . GetCredentialReportResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetCredentialReportCommandError = async ( output , context ) : Promise < GetCredentialReportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "CredentialReportExpiredException" : case "com.amazonaws.iam#CredentialReportExpiredException" : response = { ... ( await deserializeAws_queryCredentialReportExpiredExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CredentialReportNotPresentException" : case "com.amazonaws.iam#CredentialReportNotPresentException" : response = { ... ( await deserializeAws_queryCredentialReportNotPresentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "CredentialReportNotReadyException" : case "com.amazonaws.iam#CredentialReportNotReadyException" : response = { ... ( await deserializeAws_queryCredentialReportNotReadyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetGroupCommand = async ( output , context ) : Promise < GetGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetGroupResponse ( data . GetGroupResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetGroupCommandError = async ( output , context ) : Promise < GetGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetGroupPolicyCommand = async ( output , context ) : Promise < GetGroupPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetGroupPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetGroupPolicyResponse ( data . GetGroupPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetGroupPolicyCommandError = async ( output , context ) : Promise < GetGroupPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetInstanceProfileCommand = async ( output , context ) : Promise < GetInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetInstanceProfileCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetInstanceProfileResponse ( data . GetInstanceProfileResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetInstanceProfileCommandError = async ( output , context ) : Promise < GetInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetLoginProfileCommand = async ( output , context ) : Promise < GetLoginProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetLoginProfileCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetLoginProfileResponse ( data . GetLoginProfileResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetLoginProfileCommandError = async ( output , context ) : Promise < GetLoginProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetOpenIDConnectProviderCommand = async ( output , context ) : Promise < GetOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetOpenIDConnectProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetOpenIDConnectProviderResponse ( data . GetOpenIDConnectProviderResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetOpenIDConnectProviderCommandError = async ( output , context ) : Promise < GetOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetOrganizationsAccessReportCommand = async ( output , context ) : Promise < GetOrganizationsAccessReportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetOrganizationsAccessReportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetOrganizationsAccessReportResponse ( data . GetOrganizationsAccessReportResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetOrganizationsAccessReportCommandError = async ( output , context ) : Promise < GetOrganizationsAccessReportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetPolicyCommand = async ( output , context ) : Promise < GetPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetPolicyResponse ( data . GetPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetPolicyCommandError = async ( output , context ) : Promise < GetPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetPolicyVersionCommand = async ( output , context ) : Promise < GetPolicyVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetPolicyVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetPolicyVersionResponse ( data . GetPolicyVersionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetPolicyVersionCommandError = async ( output , context ) : Promise < GetPolicyVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetRoleCommand = async ( output , context ) : Promise < GetRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetRoleResponse ( data . GetRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetRoleCommandError = async ( output , context ) : Promise < GetRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetRolePolicyCommand = async ( output , context ) : Promise < GetRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetRolePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetRolePolicyResponse ( data . GetRolePolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetRolePolicyCommandError = async ( output , context ) : Promise < GetRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetSAMLProviderCommand = async ( output , context ) : Promise < GetSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetSAMLProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetSAMLProviderResponse ( data . GetSAMLProviderResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetSAMLProviderCommandError = async ( output , context ) : Promise < GetSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetServerCertificateCommand = async ( output , context ) : Promise < GetServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetServerCertificateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetServerCertificateResponse ( data . GetServerCertificateResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetServerCertificateCommandError = async ( output , context ) : Promise < GetServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetServiceLastAccessedDetailsCommand = async ( output , context ) : Promise < GetServiceLastAccessedDetailsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetServiceLastAccessedDetailsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetServiceLastAccessedDetailsResponse ( data . GetServiceLastAccessedDetailsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetServiceLastAccessedDetailsCommandError = async ( output , context ) : Promise < GetServiceLastAccessedDetailsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommand = async ( output , context ) : Promise < GetServiceLastAccessedDetailsWithEntitiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesResponse ( data . GetServiceLastAccessedDetailsWithEntitiesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesCommandError = async ( output , context ) : Promise < GetServiceLastAccessedDetailsWithEntitiesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommand = async ( output , context ) : Promise < GetServiceLinkedRoleDeletionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetServiceLinkedRoleDeletionStatusResponse ( data . GetServiceLinkedRoleDeletionStatusResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetServiceLinkedRoleDeletionStatusCommandError = async ( output , context ) : Promise < GetServiceLinkedRoleDeletionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetSSHPublicKeyCommand = async ( output , context ) : Promise < GetSSHPublicKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetSSHPublicKeyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetSSHPublicKeyResponse ( data . GetSSHPublicKeyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetSSHPublicKeyCommandError = async ( output , context ) : Promise < GetSSHPublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnrecognizedPublicKeyEncodingException" : case "com.amazonaws.iam#UnrecognizedPublicKeyEncodingException" : response = { ... ( await deserializeAws_queryUnrecognizedPublicKeyEncodingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetUserCommand = async ( output , context ) : Promise < GetUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetUserResponse ( data . GetUserResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetUserCommandError = async ( output , context ) : Promise < GetUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryGetUserPolicyCommand = async ( output , context ) : Promise < GetUserPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryGetUserPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryGetUserPolicyResponse ( data . GetUserPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryGetUserPolicyCommandError = async ( output , context ) : Promise < GetUserPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAccessKeysCommand = async ( output , context ) : Promise < ListAccessKeysCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAccessKeysCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAccessKeysResponse ( data . ListAccessKeysResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAccessKeysCommandError = async ( output , context ) : Promise < ListAccessKeysCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAccountAliasesCommand = async ( output , context ) : Promise < ListAccountAliasesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAccountAliasesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAccountAliasesResponse ( data . ListAccountAliasesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAccountAliasesCommandError = async ( output , context ) : Promise < ListAccountAliasesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAttachedGroupPoliciesCommand = async ( output , context ) : Promise < ListAttachedGroupPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAttachedGroupPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAttachedGroupPoliciesResponse ( data . ListAttachedGroupPoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAttachedGroupPoliciesCommandError = async ( output , context ) : Promise < ListAttachedGroupPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAttachedRolePoliciesCommand = async ( output , context ) : Promise < ListAttachedRolePoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAttachedRolePoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAttachedRolePoliciesResponse ( data . ListAttachedRolePoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAttachedRolePoliciesCommandError = async ( output , context ) : Promise < ListAttachedRolePoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListAttachedUserPoliciesCommand = async ( output , context ) : Promise < ListAttachedUserPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListAttachedUserPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListAttachedUserPoliciesResponse ( data . ListAttachedUserPoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListAttachedUserPoliciesCommandError = async ( output , context ) : Promise < ListAttachedUserPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListEntitiesForPolicyCommand = async ( output , context ) : Promise < ListEntitiesForPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListEntitiesForPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListEntitiesForPolicyResponse ( data . ListEntitiesForPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListEntitiesForPolicyCommandError = async ( output , context ) : Promise < ListEntitiesForPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListGroupPoliciesCommand = async ( output , context ) : Promise < ListGroupPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListGroupPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListGroupPoliciesResponse ( data . ListGroupPoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListGroupPoliciesCommandError = async ( output , context ) : Promise < ListGroupPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListGroupsCommand = async ( output , context ) : Promise < ListGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListGroupsResponse ( data . ListGroupsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListGroupsCommandError = async ( output , context ) : Promise < ListGroupsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListGroupsForUserCommand = async ( output , context ) : Promise < ListGroupsForUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListGroupsForUserCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListGroupsForUserResponse ( data . ListGroupsForUserResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListGroupsForUserCommandError = async ( output , context ) : Promise < ListGroupsForUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListInstanceProfilesCommand = async ( output , context ) : Promise < ListInstanceProfilesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListInstanceProfilesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListInstanceProfilesResponse ( data . ListInstanceProfilesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListInstanceProfilesCommandError = async ( output , context ) : Promise < ListInstanceProfilesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListInstanceProfilesForRoleCommand = async ( output , context ) : Promise < ListInstanceProfilesForRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListInstanceProfilesForRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListInstanceProfilesForRoleResponse ( data . ListInstanceProfilesForRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListInstanceProfilesForRoleCommandError = async ( output , context ) : Promise < ListInstanceProfilesForRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListInstanceProfileTagsCommand = async ( output , context ) : Promise < ListInstanceProfileTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListInstanceProfileTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListInstanceProfileTagsResponse ( data . ListInstanceProfileTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListInstanceProfileTagsCommandError = async ( output , context ) : Promise < ListInstanceProfileTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListMFADevicesCommand = async ( output , context ) : Promise < ListMFADevicesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListMFADevicesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListMFADevicesResponse ( data . ListMFADevicesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListMFADevicesCommandError = async ( output , context ) : Promise < ListMFADevicesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListMFADeviceTagsCommand = async ( output , context ) : Promise < ListMFADeviceTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListMFADeviceTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListMFADeviceTagsResponse ( data . ListMFADeviceTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListMFADeviceTagsCommandError = async ( output , context ) : Promise < ListMFADeviceTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListOpenIDConnectProvidersCommand = async ( output , context ) : Promise < ListOpenIDConnectProvidersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListOpenIDConnectProvidersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListOpenIDConnectProvidersResponse ( data . ListOpenIDConnectProvidersResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListOpenIDConnectProvidersCommandError = async ( output , context ) : Promise < ListOpenIDConnectProvidersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListOpenIDConnectProviderTagsCommand = async ( output , context ) : Promise < ListOpenIDConnectProviderTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListOpenIDConnectProviderTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListOpenIDConnectProviderTagsResponse ( data . ListOpenIDConnectProviderTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListOpenIDConnectProviderTagsCommandError = async ( output , context ) : Promise < ListOpenIDConnectProviderTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPoliciesCommand = async ( output , context ) : Promise < ListPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPoliciesResponse ( data . ListPoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPoliciesCommandError = async ( output , context ) : Promise < ListPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPoliciesGrantingServiceAccessCommand = async ( output , context ) : Promise < ListPoliciesGrantingServiceAccessCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPoliciesGrantingServiceAccessCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPoliciesGrantingServiceAccessResponse ( data . ListPoliciesGrantingServiceAccessResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPoliciesGrantingServiceAccessCommandError = async ( output , context ) : Promise < ListPoliciesGrantingServiceAccessCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPolicyTagsCommand = async ( output , context ) : Promise < ListPolicyTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPolicyTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPolicyTagsResponse ( data . ListPolicyTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPolicyTagsCommandError = async ( output , context ) : Promise < ListPolicyTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListPolicyVersionsCommand = async ( output , context ) : Promise < ListPolicyVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListPolicyVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListPolicyVersionsResponse ( data . ListPolicyVersionsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListPolicyVersionsCommandError = async ( output , context ) : Promise < ListPolicyVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListRolePoliciesCommand = async ( output , context ) : Promise < ListRolePoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListRolePoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListRolePoliciesResponse ( data . ListRolePoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListRolePoliciesCommandError = async ( output , context ) : Promise < ListRolePoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListRolesCommand = async ( output , context ) : Promise < ListRolesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListRolesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListRolesResponse ( data . ListRolesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListRolesCommandError = async ( output , context ) : Promise < ListRolesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListRoleTagsCommand = async ( output , context ) : Promise < ListRoleTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListRoleTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListRoleTagsResponse ( data . ListRoleTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListRoleTagsCommandError = async ( output , context ) : Promise < ListRoleTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListSAMLProvidersCommand = async ( output , context ) : Promise < ListSAMLProvidersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListSAMLProvidersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListSAMLProvidersResponse ( data . ListSAMLProvidersResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListSAMLProvidersCommandError = async ( output , context ) : Promise < ListSAMLProvidersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListSAMLProviderTagsCommand = async ( output , context ) : Promise < ListSAMLProviderTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListSAMLProviderTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListSAMLProviderTagsResponse ( data . ListSAMLProviderTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListSAMLProviderTagsCommandError = async ( output , context ) : Promise < ListSAMLProviderTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListServerCertificatesCommand = async ( output , context ) : Promise < ListServerCertificatesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListServerCertificatesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListServerCertificatesResponse ( data . ListServerCertificatesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListServerCertificatesCommandError = async ( output , context ) : Promise < ListServerCertificatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListServerCertificateTagsCommand = async ( output , context ) : Promise < ListServerCertificateTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListServerCertificateTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListServerCertificateTagsResponse ( data . ListServerCertificateTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListServerCertificateTagsCommandError = async ( output , context ) : Promise < ListServerCertificateTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListServiceSpecificCredentialsCommand = async ( output , context ) : Promise < ListServiceSpecificCredentialsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListServiceSpecificCredentialsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListServiceSpecificCredentialsResponse ( data . ListServiceSpecificCredentialsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListServiceSpecificCredentialsCommandError = async ( output , context ) : Promise < ListServiceSpecificCredentialsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceNotSupportedException" : case "com.amazonaws.iam#ServiceNotSupportedException" : response = { ... ( await deserializeAws_queryServiceNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListSigningCertificatesCommand = async ( output , context ) : Promise < ListSigningCertificatesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListSigningCertificatesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListSigningCertificatesResponse ( data . ListSigningCertificatesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListSigningCertificatesCommandError = async ( output , context ) : Promise < ListSigningCertificatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListSSHPublicKeysCommand = async ( output , context ) : Promise < ListSSHPublicKeysCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListSSHPublicKeysCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListSSHPublicKeysResponse ( data . ListSSHPublicKeysResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListSSHPublicKeysCommandError = async ( output , context ) : Promise < ListSSHPublicKeysCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListUserPoliciesCommand = async ( output , context ) : Promise < ListUserPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListUserPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListUserPoliciesResponse ( data . ListUserPoliciesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListUserPoliciesCommandError = async ( output , context ) : Promise < ListUserPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListUsersCommand = async ( output , context ) : Promise < ListUsersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListUsersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListUsersResponse ( data . ListUsersResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListUsersCommandError = async ( output , context ) : Promise < ListUsersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListUserTagsCommand = async ( output , context ) : Promise < ListUserTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListUserTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListUserTagsResponse ( data . ListUserTagsResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListUserTagsCommandError = async ( output , context ) : Promise < ListUserTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryListVirtualMFADevicesCommand = async ( output , context ) : Promise < ListVirtualMFADevicesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryListVirtualMFADevicesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryListVirtualMFADevicesResponse ( data . ListVirtualMFADevicesResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryListVirtualMFADevicesCommandError = async ( output , context ) : Promise < ListVirtualMFADevicesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryPutGroupPolicyCommand = async ( output , context ) : Promise < PutGroupPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryPutGroupPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryPutGroupPolicyCommandError = async ( output , context ) : Promise < PutGroupPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryPutRolePermissionsBoundaryCommand = async ( output , context ) : Promise < PutRolePermissionsBoundaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryPutRolePermissionsBoundaryCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryPutRolePermissionsBoundaryCommandError = async ( output , context ) : Promise < PutRolePermissionsBoundaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyNotAttachableException" : case "com.amazonaws.iam#PolicyNotAttachableException" : response = { ... ( await deserializeAws_queryPolicyNotAttachableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryPutRolePolicyCommand = async ( output , context ) : Promise < PutRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryPutRolePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryPutRolePolicyCommandError = async ( output , context ) : Promise < PutRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryPutUserPermissionsBoundaryCommand = async ( output , context ) : Promise < PutUserPermissionsBoundaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryPutUserPermissionsBoundaryCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryPutUserPermissionsBoundaryCommandError = async ( output , context ) : Promise < PutUserPermissionsBoundaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyNotAttachableException" : case "com.amazonaws.iam#PolicyNotAttachableException" : response = { ... ( await deserializeAws_queryPolicyNotAttachableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryPutUserPolicyCommand = async ( output , context ) : Promise < PutUserPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryPutUserPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryPutUserPolicyCommandError = async ( output , context ) : Promise < PutUserPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommand = async ( output , context ) : Promise < RemoveClientIDFromOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRemoveClientIDFromOpenIDConnectProviderCommandError = async ( output , context ) : Promise < RemoveClientIDFromOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRemoveRoleFromInstanceProfileCommand = async ( output , context ) : Promise < RemoveRoleFromInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRemoveRoleFromInstanceProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRemoveRoleFromInstanceProfileCommandError = async ( output , context ) : Promise < RemoveRoleFromInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryRemoveUserFromGroupCommand = async ( output , context ) : Promise < RemoveUserFromGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryRemoveUserFromGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryRemoveUserFromGroupCommandError = async ( output , context ) : Promise < RemoveUserFromGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryResetServiceSpecificCredentialCommand = async ( output , context ) : Promise < ResetServiceSpecificCredentialCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryResetServiceSpecificCredentialCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryResetServiceSpecificCredentialResponse ( data . ResetServiceSpecificCredentialResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryResetServiceSpecificCredentialCommandError = async ( output , context ) : Promise < ResetServiceSpecificCredentialCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryResyncMFADeviceCommand = async ( output , context ) : Promise < ResyncMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryResyncMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryResyncMFADeviceCommandError = async ( output , context ) : Promise < ResyncMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidAuthenticationCodeException" : case "com.amazonaws.iam#InvalidAuthenticationCodeException" : response = { ... ( await deserializeAws_queryInvalidAuthenticationCodeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_querySetDefaultPolicyVersionCommand = async ( output , context ) : Promise < SetDefaultPolicyVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_querySetDefaultPolicyVersionCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_querySetDefaultPolicyVersionCommandError = async ( output , context ) : Promise < SetDefaultPolicyVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_querySetSecurityTokenServicePreferencesCommand = async ( output , context ) : Promise < SetSecurityTokenServicePreferencesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_querySetSecurityTokenServicePreferencesCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_querySetSecurityTokenServicePreferencesCommandError = async ( output , context ) : Promise < SetSecurityTokenServicePreferencesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_querySimulateCustomPolicyCommand = async ( output , context ) : Promise < SimulateCustomPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_querySimulateCustomPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_querySimulatePolicyResponse ( data . SimulateCustomPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_querySimulateCustomPolicyCommandError = async ( output , context ) : Promise < SimulateCustomPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyEvaluationException" : case "com.amazonaws.iam#PolicyEvaluationException" : response = { ... ( await deserializeAws_queryPolicyEvaluationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_querySimulatePrincipalPolicyCommand = async ( output , context ) : Promise < SimulatePrincipalPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_querySimulatePrincipalPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_querySimulatePolicyResponse ( data . SimulatePrincipalPolicyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_querySimulatePrincipalPolicyCommandError = async ( output , context ) : Promise < SimulatePrincipalPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PolicyEvaluationException" : case "com.amazonaws.iam#PolicyEvaluationException" : response = { ... ( await deserializeAws_queryPolicyEvaluationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagInstanceProfileCommand = async ( output , context ) : Promise < TagInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagInstanceProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagInstanceProfileCommandError = async ( output , context ) : Promise < TagInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagMFADeviceCommand = async ( output , context ) : Promise < TagMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagMFADeviceCommandError = async ( output , context ) : Promise < TagMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagOpenIDConnectProviderCommand = async ( output , context ) : Promise < TagOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagOpenIDConnectProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagOpenIDConnectProviderCommandError = async ( output , context ) : Promise < TagOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagPolicyCommand = async ( output , context ) : Promise < TagPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagPolicyCommandError = async ( output , context ) : Promise < TagPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagRoleCommand = async ( output , context ) : Promise < TagRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagRoleCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagRoleCommandError = async ( output , context ) : Promise < TagRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagSAMLProviderCommand = async ( output , context ) : Promise < TagSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagSAMLProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagSAMLProviderCommandError = async ( output , context ) : Promise < TagSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagServerCertificateCommand = async ( output , context ) : Promise < TagServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagServerCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagServerCertificateCommandError = async ( output , context ) : Promise < TagServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryTagUserCommand = async ( output , context ) : Promise < TagUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryTagUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryTagUserCommandError = async ( output , context ) : Promise < TagUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagInstanceProfileCommand = async ( output , context ) : Promise < UntagInstanceProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagInstanceProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagInstanceProfileCommandError = async ( output , context ) : Promise < UntagInstanceProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagMFADeviceCommand = async ( output , context ) : Promise < UntagMFADeviceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagMFADeviceCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagMFADeviceCommandError = async ( output , context ) : Promise < UntagMFADeviceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagOpenIDConnectProviderCommand = async ( output , context ) : Promise < UntagOpenIDConnectProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagOpenIDConnectProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagOpenIDConnectProviderCommandError = async ( output , context ) : Promise < UntagOpenIDConnectProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagPolicyCommand = async ( output , context ) : Promise < UntagPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagPolicyCommandError = async ( output , context ) : Promise < UntagPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagRoleCommand = async ( output , context ) : Promise < UntagRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagRoleCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagRoleCommandError = async ( output , context ) : Promise < UntagRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagSAMLProviderCommand = async ( output , context ) : Promise < UntagSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagSAMLProviderCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagSAMLProviderCommandError = async ( output , context ) : Promise < UntagSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagServerCertificateCommand = async ( output , context ) : Promise < UntagServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagServerCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagServerCertificateCommandError = async ( output , context ) : Promise < UntagServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUntagUserCommand = async ( output , context ) : Promise < UntagUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUntagUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUntagUserCommandError = async ( output , context ) : Promise < UntagUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateAccessKeyCommand = async ( output , context ) : Promise < UpdateAccessKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateAccessKeyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateAccessKeyCommandError = async ( output , context ) : Promise < UpdateAccessKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateAccountPasswordPolicyCommand = async ( output , context ) : Promise < UpdateAccountPasswordPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateAccountPasswordPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateAccountPasswordPolicyCommandError = async ( output , context ) : Promise < UpdateAccountPasswordPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateAssumeRolePolicyCommand = async ( output , context ) : Promise < UpdateAssumeRolePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateAssumeRolePolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateAssumeRolePolicyCommandError = async ( output , context ) : Promise < UpdateAssumeRolePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedPolicyDocumentException" : case "com.amazonaws.iam#MalformedPolicyDocumentException" : response = { ... ( await deserializeAws_queryMalformedPolicyDocumentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateGroupCommand = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateGroupCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateGroupCommandError = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateLoginProfileCommand = async ( output , context ) : Promise < UpdateLoginProfileCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateLoginProfileCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateLoginProfileCommandError = async ( output , context ) : Promise < UpdateLoginProfileCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PasswordPolicyViolationException" : case "com.amazonaws.iam#PasswordPolicyViolationException" : response = { ... ( await deserializeAws_queryPasswordPolicyViolationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommand = async ( output , context ) : Promise < UpdateOpenIDConnectProviderThumbprintCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateOpenIDConnectProviderThumbprintCommandError = async ( output , context ) : Promise < UpdateOpenIDConnectProviderThumbprintCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateRoleCommand = async ( output , context ) : Promise < UpdateRoleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateRoleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUpdateRoleResponse ( data . UpdateRoleResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateRoleCommandError = async ( output , context ) : Promise < UpdateRoleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateRoleDescriptionCommand = async ( output , context ) : Promise < UpdateRoleDescriptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateRoleDescriptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUpdateRoleDescriptionResponse ( data . UpdateRoleDescriptionResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateRoleDescriptionCommandError = async ( output , context ) : Promise < UpdateRoleDescriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnmodifiableEntityException" : case "com.amazonaws.iam#UnmodifiableEntityException" : response = { ... ( await deserializeAws_queryUnmodifiableEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateSAMLProviderCommand = async ( output , context ) : Promise < UpdateSAMLProviderCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateSAMLProviderCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUpdateSAMLProviderResponse ( data . UpdateSAMLProviderResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateSAMLProviderCommandError = async ( output , context ) : Promise < UpdateSAMLProviderCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateServerCertificateCommand = async ( output , context ) : Promise < UpdateServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateServerCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateServerCertificateCommandError = async ( output , context ) : Promise < UpdateServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateServiceSpecificCredentialCommand = async ( output , context ) : Promise < UpdateServiceSpecificCredentialCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateServiceSpecificCredentialCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateServiceSpecificCredentialCommandError = async ( output , context ) : Promise < UpdateServiceSpecificCredentialCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateSigningCertificateCommand = async ( output , context ) : Promise < UpdateSigningCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateSigningCertificateCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateSigningCertificateCommandError = async ( output , context ) : Promise < UpdateSigningCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateSSHPublicKeyCommand = async ( output , context ) : Promise < UpdateSSHPublicKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateSSHPublicKeyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateSSHPublicKeyCommandError = async ( output , context ) : Promise < UpdateSSHPublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUpdateUserCommand = async ( output , context ) : Promise < UpdateUserCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUpdateUserCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUpdateUserCommandError = async ( output , context ) : Promise < UpdateUserCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityTemporarilyUnmodifiableException" : case "com.amazonaws.iam#EntityTemporarilyUnmodifiableException" : response = { ... ( await deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUploadServerCertificateCommand = async ( output , context ) : Promise < UploadServerCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUploadServerCertificateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUploadServerCertificateResponse ( data . UploadServerCertificateResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUploadServerCertificateCommandError = async ( output , context ) : Promise < UploadServerCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentModificationException" : case "com.amazonaws.iam#ConcurrentModificationException" : response = { ... ( await deserializeAws_queryConcurrentModificationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidInputException" : case "com.amazonaws.iam#InvalidInputException" : response = { ... ( await deserializeAws_queryInvalidInputExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KeyPairMismatchException" : case "com.amazonaws.iam#KeyPairMismatchException" : response = { ... ( await deserializeAws_queryKeyPairMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedCertificateException" : case "com.amazonaws.iam#MalformedCertificateException" : response = { ... ( await deserializeAws_queryMalformedCertificateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUploadSigningCertificateCommand = async ( output , context ) : Promise < UploadSigningCertificateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUploadSigningCertificateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUploadSigningCertificateResponse ( data . UploadSigningCertificateResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUploadSigningCertificateCommandError = async ( output , context ) : Promise < UploadSigningCertificateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateCertificateException" : case "com.amazonaws.iam#DuplicateCertificateException" : response = { ... ( await deserializeAws_queryDuplicateCertificateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntityAlreadyExistsException" : case "com.amazonaws.iam#EntityAlreadyExistsException" : response = { ... ( await deserializeAws_queryEntityAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidCertificateException" : case "com.amazonaws.iam#InvalidCertificateException" : response = { ... ( await deserializeAws_queryInvalidCertificateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MalformedCertificateException" : case "com.amazonaws.iam#MalformedCertificateException" : response = { ... ( await deserializeAws_queryMalformedCertificateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceFailureException" : case "com.amazonaws.iam#ServiceFailureException" : response = { ... ( await deserializeAws_queryServiceFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_queryUploadSSHPublicKeyCommand = async ( output , context ) : Promise < UploadSSHPublicKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_queryUploadSSHPublicKeyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_queryUploadSSHPublicKeyResponse ( data . UploadSSHPublicKeyResult , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_queryUploadSSHPublicKeyCommandError = async ( output , context ) : Promise < UploadSSHPublicKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadQueryErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DuplicateSSHPublicKeyException" : case "com.amazonaws.iam#DuplicateSSHPublicKeyException" : response = { ... ( await deserializeAws_queryDuplicateSSHPublicKeyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidPublicKeyException" : case "com.amazonaws.iam#InvalidPublicKeyException" : response = { ... ( await deserializeAws_queryInvalidPublicKeyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.iam#LimitExceededException" : response = { ... ( await deserializeAws_queryLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoSuchEntityException" : case "com.amazonaws.iam#NoSuchEntityException" : response = { ... ( await deserializeAws_queryNoSuchEntityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnrecognizedPublicKeyEncodingException" : case "com.amazonaws.iam#UnrecognizedPublicKeyEncodingException" : response = { ... ( await deserializeAws_queryUnrecognizedPublicKeyEncodingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . Error . code || parsedBody . Error . Code || errorCode ; response = { ... parsedBody . Error , name : `${ errorCode }` , message : parsedBody . Error . message || parsedBody . Error . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_queryConcurrentModificationExceptionResponse = async ( parsedOutput , context ) : Promise < ConcurrentModificationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryConcurrentModificationException ( body . Error , context ) ; const contents = { name : "ConcurrentModificationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryCredentialReportExpiredExceptionResponse = async ( parsedOutput , context ) : Promise < CredentialReportExpiredException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryCredentialReportExpiredException ( body . Error , context ) ; const contents = { name : "CredentialReportExpiredException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryCredentialReportNotPresentExceptionResponse = async ( parsedOutput , context ) : Promise < CredentialReportNotPresentException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryCredentialReportNotPresentException ( body . Error , context ) ; const contents = { name : "CredentialReportNotPresentException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryCredentialReportNotReadyExceptionResponse = async ( parsedOutput , context ) : Promise < CredentialReportNotReadyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryCredentialReportNotReadyException ( body . Error , context ) ; const contents = { name : "CredentialReportNotReadyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryDeleteConflictExceptionResponse = async ( parsedOutput , context ) : Promise < DeleteConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryDeleteConflictException ( body . Error , context ) ; const contents = { name : "DeleteConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryDuplicateCertificateExceptionResponse = async ( parsedOutput , context ) : Promise < DuplicateCertificateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryDuplicateCertificateException ( body . Error , context ) ; const contents = { name : "DuplicateCertificateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryDuplicateSSHPublicKeyExceptionResponse = async ( parsedOutput , context ) : Promise < DuplicateSSHPublicKeyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryDuplicateSSHPublicKeyException ( body . Error , context ) ; const contents = { name : "DuplicateSSHPublicKeyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryEntityAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < EntityAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryEntityAlreadyExistsException ( body . Error , context ) ; const contents = { name : "EntityAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryEntityTemporarilyUnmodifiableExceptionResponse = async ( parsedOutput , context ) : Promise < EntityTemporarilyUnmodifiableException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryEntityTemporarilyUnmodifiableException ( body . Error , context ) ; const contents = { name : "EntityTemporarilyUnmodifiableException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidAuthenticationCodeExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidAuthenticationCodeException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidAuthenticationCodeException ( body . Error , context ) ; const contents = { name : "InvalidAuthenticationCodeException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidCertificateExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidCertificateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidCertificateException ( body . Error , context ) ; const contents = { name : "InvalidCertificateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidInputExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidInputException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidInputException ( body . Error , context ) ; const contents = { name : "InvalidInputException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidPublicKeyExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidPublicKeyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidPublicKeyException ( body . Error , context ) ; const contents = { name : "InvalidPublicKeyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryInvalidUserTypeExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidUserTypeException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryInvalidUserTypeException ( body . Error , context ) ; const contents = { name : "InvalidUserTypeException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryKeyPairMismatchExceptionResponse = async ( parsedOutput , context ) : Promise < KeyPairMismatchException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryKeyPairMismatchException ( body . Error , context ) ; const contents = { name : "KeyPairMismatchException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryLimitExceededException ( body . Error , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryMalformedCertificateExceptionResponse = async ( parsedOutput , context ) : Promise < MalformedCertificateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryMalformedCertificateException ( body . Error , context ) ; const contents = { name : "MalformedCertificateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryMalformedPolicyDocumentExceptionResponse = async ( parsedOutput , context ) : Promise < MalformedPolicyDocumentException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryMalformedPolicyDocumentException ( body . Error , context ) ; const contents = { name : "MalformedPolicyDocumentException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryNoSuchEntityExceptionResponse = async ( parsedOutput , context ) : Promise < NoSuchEntityException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryNoSuchEntityException ( body . Error , context ) ; const contents = { name : "NoSuchEntityException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryPasswordPolicyViolationExceptionResponse = async ( parsedOutput , context ) : Promise < PasswordPolicyViolationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryPasswordPolicyViolationException ( body . Error , context ) ; const contents = { name : "PasswordPolicyViolationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryPolicyEvaluationExceptionResponse = async ( parsedOutput , context ) : Promise < PolicyEvaluationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryPolicyEvaluationException ( body . Error , context ) ; const contents = { name : "PolicyEvaluationException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryPolicyNotAttachableExceptionResponse = async ( parsedOutput , context ) : Promise < PolicyNotAttachableException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryPolicyNotAttachableException ( body . Error , context ) ; const contents = { name : "PolicyNotAttachableException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryReportGenerationLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ReportGenerationLimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryReportGenerationLimitExceededException ( body . Error , context ) ; const contents = { name : "ReportGenerationLimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryServiceFailureExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceFailureException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryServiceFailureException ( body . Error , context ) ; const contents = { name : "ServiceFailureException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryServiceNotSupportedExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceNotSupportedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryServiceNotSupportedException ( body . Error , context ) ; const contents = { name : "ServiceNotSupportedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryUnmodifiableEntityExceptionResponse = async ( parsedOutput , context ) : Promise < UnmodifiableEntityException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryUnmodifiableEntityException ( body . Error , context ) ; const contents = { name : "UnmodifiableEntityException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_queryUnrecognizedPublicKeyEncodingExceptionResponse = async ( parsedOutput , context ) : Promise < UnrecognizedPublicKeyEncodingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_queryUnrecognizedPublicKeyEncodingException ( body . Error , context ) ; const contents = { name : "UnrecognizedPublicKeyEncodingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_queryActionNameListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryAddClientIDToOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . ClientID !== undefined && input . ClientID !== null ) { entries [ "ClientID" ] = input . ClientID ; } return entries ; } ; const serializeAws_queryAddRoleToInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryAddUserToGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryAttachGroupPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryAttachRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryAttachUserPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryChangePasswordRequest = ( input , context ) : any => { const entries = { } ; if ( input . OldPassword !== undefined && input . OldPassword !== null ) { entries [ "OldPassword" ] = input . OldPassword ; } if ( input . NewPassword !== undefined && input . NewPassword !== null ) { entries [ "NewPassword" ] = input . NewPassword ; } return entries ; } ; const serializeAws_queryclientIDListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryContextEntry = ( input , context ) : any => { const entries = { } ; if ( input . ContextKeyName !== undefined && input . ContextKeyName !== null ) { entries [ "ContextKeyName" ] = input . ContextKeyName ; } if ( input . ContextKeyValues !== undefined && input . ContextKeyValues !== null ) { const memberEntries = serializeAws_queryContextKeyValueListType ( input . ContextKeyValues , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ContextKeyValues.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ContextKeyType !== undefined && input . ContextKeyType !== null ) { entries [ "ContextKeyType" ] = input . ContextKeyType ; } return entries ; } ; const serializeAws_queryContextEntryListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryContextEntry ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryContextKeyValueListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryCreateAccessKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryCreateAccountAliasRequest = ( input , context ) : any => { const entries = { } ; if ( input . AccountAlias !== undefined && input . AccountAlias !== null ) { entries [ "AccountAlias" ] = input . AccountAlias ; } return entries ; } ; const serializeAws_queryCreateGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } return entries ; } ; const serializeAws_queryCreateInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateLoginProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Password !== undefined && input . Password !== null ) { entries [ "Password" ] = input . Password ; } if ( input . PasswordResetRequired !== undefined && input . PasswordResetRequired !== null ) { entries [ "PasswordResetRequired" ] = input . PasswordResetRequired ; } return entries ; } ; const serializeAws_queryCreateOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . Url !== undefined && input . Url !== null ) { entries [ "Url" ] = input . Url ; } if ( input . ClientIDList !== undefined && input . ClientIDList !== null ) { const memberEntries = serializeAws_queryclientIDListType ( input . ClientIDList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ClientIDList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ThumbprintList !== undefined && input . ThumbprintList !== null ) { const memberEntries = serializeAws_querythumbprintListType ( input . ThumbprintList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ThumbprintList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreatePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreatePolicyVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } if ( input . SetAsDefault !== undefined && input . SetAsDefault !== null ) { entries [ "SetAsDefault" ] = input . SetAsDefault ; } return entries ; } ; const serializeAws_queryCreateRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . AssumeRolePolicyDocument !== undefined && input . AssumeRolePolicyDocument !== null ) { entries [ "AssumeRolePolicyDocument" ] = input . AssumeRolePolicyDocument ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . MaxSessionDuration !== undefined && input . MaxSessionDuration !== null ) { entries [ "MaxSessionDuration" ] = input . MaxSessionDuration ; } if ( input . PermissionsBoundary !== undefined && input . PermissionsBoundary !== null ) { entries [ "PermissionsBoundary" ] = input . PermissionsBoundary ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLMetadataDocument !== undefined && input . SAMLMetadataDocument !== null ) { entries [ "SAMLMetadataDocument" ] = input . SAMLMetadataDocument ; } if ( input . Name !== undefined && input . Name !== null ) { entries [ "Name" ] = input . Name ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateServiceLinkedRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . AWSServiceName !== undefined && input . AWSServiceName !== null ) { entries [ "AWSServiceName" ] = input . AWSServiceName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . CustomSuffix !== undefined && input . CustomSuffix !== null ) { entries [ "CustomSuffix" ] = input . CustomSuffix ; } return entries ; } ; const serializeAws_queryCreateServiceSpecificCredentialRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . ServiceName !== undefined && input . ServiceName !== null ) { entries [ "ServiceName" ] = input . ServiceName ; } return entries ; } ; const serializeAws_queryCreateUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PermissionsBoundary !== undefined && input . PermissionsBoundary !== null ) { entries [ "PermissionsBoundary" ] = input . PermissionsBoundary ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryCreateVirtualMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . VirtualMFADeviceName !== undefined && input . VirtualMFADeviceName !== null ) { entries [ "VirtualMFADeviceName" ] = input . VirtualMFADeviceName ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryDeactivateMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } return entries ; } ; const serializeAws_queryDeleteAccessKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . AccessKeyId !== undefined && input . AccessKeyId !== null ) { entries [ "AccessKeyId" ] = input . AccessKeyId ; } return entries ; } ; const serializeAws_queryDeleteAccountAliasRequest = ( input , context ) : any => { const entries = { } ; if ( input . AccountAlias !== undefined && input . AccountAlias !== null ) { entries [ "AccountAlias" ] = input . AccountAlias ; } return entries ; } ; const serializeAws_queryDeleteGroupPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryDeleteGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } return entries ; } ; const serializeAws_queryDeleteInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } return entries ; } ; const serializeAws_queryDeleteLoginProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryDeleteOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } return entries ; } ; const serializeAws_queryDeletePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryDeletePolicyVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . VersionId !== undefined && input . VersionId !== null ) { entries [ "VersionId" ] = input . VersionId ; } return entries ; } ; const serializeAws_queryDeleteRolePermissionsBoundaryRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryDeleteRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryDeleteRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryDeleteSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } return entries ; } ; const serializeAws_queryDeleteServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } return entries ; } ; const serializeAws_queryDeleteServiceLinkedRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryDeleteServiceSpecificCredentialRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . ServiceSpecificCredentialId !== undefined && input . ServiceSpecificCredentialId !== null ) { entries [ "ServiceSpecificCredentialId" ] = input . ServiceSpecificCredentialId ; } return entries ; } ; const serializeAws_queryDeleteSigningCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . CertificateId !== undefined && input . CertificateId !== null ) { entries [ "CertificateId" ] = input . CertificateId ; } return entries ; } ; const serializeAws_queryDeleteSSHPublicKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SSHPublicKeyId !== undefined && input . SSHPublicKeyId !== null ) { entries [ "SSHPublicKeyId" ] = input . SSHPublicKeyId ; } return entries ; } ; const serializeAws_queryDeleteUserPermissionsBoundaryRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryDeleteUserPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryDeleteUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryDeleteVirtualMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } return entries ; } ; const serializeAws_queryDetachGroupPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryDetachRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryDetachUserPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryEnableMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } if ( input . AuthenticationCode1 !== undefined && input . AuthenticationCode1 !== null ) { entries [ "AuthenticationCode1" ] = input . AuthenticationCode1 ; } if ( input . AuthenticationCode2 !== undefined && input . AuthenticationCode2 !== null ) { entries [ "AuthenticationCode2" ] = input . AuthenticationCode2 ; } return entries ; } ; const serializeAws_queryentityListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryGenerateOrganizationsAccessReportRequest = ( input , context ) : any => { const entries = { } ; if ( input . EntityPath !== undefined && input . EntityPath !== null ) { entries [ "EntityPath" ] = input . EntityPath ; } if ( input . OrganizationsPolicyId !== undefined && input . OrganizationsPolicyId !== null ) { entries [ "OrganizationsPolicyId" ] = input . OrganizationsPolicyId ; } return entries ; } ; const serializeAws_queryGenerateServiceLastAccessedDetailsRequest = ( input , context ) : any => { const entries = { } ; if ( input . Arn !== undefined && input . Arn !== null ) { entries [ "Arn" ] = input . Arn ; } if ( input . Granularity !== undefined && input . Granularity !== null ) { entries [ "Granularity" ] = input . Granularity ; } return entries ; } ; const serializeAws_queryGetAccessKeyLastUsedRequest = ( input , context ) : any => { const entries = { } ; if ( input . AccessKeyId !== undefined && input . AccessKeyId !== null ) { entries [ "AccessKeyId" ] = input . AccessKeyId ; } return entries ; } ; const serializeAws_queryGetAccountAuthorizationDetailsRequest = ( input , context ) : any => { const entries = { } ; if ( input . Filter !== undefined && input . Filter !== null ) { const memberEntries = serializeAws_queryentityListType ( input . Filter , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Filter.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } return entries ; } ; const serializeAws_queryGetContextKeysForCustomPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyInputList !== undefined && input . PolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryGetContextKeysForPrincipalPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicySourceArn !== undefined && input . PolicySourceArn !== null ) { entries [ "PolicySourceArn" ] = input . PolicySourceArn ; } if ( input . PolicyInputList !== undefined && input . PolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryGetGroupPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryGetGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryGetInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } return entries ; } ; const serializeAws_queryGetLoginProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryGetOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } return entries ; } ; const serializeAws_queryGetOrganizationsAccessReportRequest = ( input , context ) : any => { const entries = { } ; if ( input . JobId !== undefined && input . JobId !== null ) { entries [ "JobId" ] = input . JobId ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . SortKey !== undefined && input . SortKey !== null ) { entries [ "SortKey" ] = input . SortKey ; } return entries ; } ; const serializeAws_queryGetPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } return entries ; } ; const serializeAws_queryGetPolicyVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . VersionId !== undefined && input . VersionId !== null ) { entries [ "VersionId" ] = input . VersionId ; } return entries ; } ; const serializeAws_queryGetRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryGetRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryGetSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } return entries ; } ; const serializeAws_queryGetServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } return entries ; } ; const serializeAws_queryGetServiceLastAccessedDetailsRequest = ( input , context ) : any => { const entries = { } ; if ( input . JobId !== undefined && input . JobId !== null ) { entries [ "JobId" ] = input . JobId ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } return entries ; } ; const serializeAws_queryGetServiceLastAccessedDetailsWithEntitiesRequest = ( input , context ) : any => { const entries = { } ; if ( input . JobId !== undefined && input . JobId !== null ) { entries [ "JobId" ] = input . JobId ; } if ( input . ServiceNamespace !== undefined && input . ServiceNamespace !== null ) { entries [ "ServiceNamespace" ] = input . ServiceNamespace ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } return entries ; } ; const serializeAws_queryGetServiceLinkedRoleDeletionStatusRequest = ( input , context ) : any => { const entries = { } ; if ( input . DeletionTaskId !== undefined && input . DeletionTaskId !== null ) { entries [ "DeletionTaskId" ] = input . DeletionTaskId ; } return entries ; } ; const serializeAws_queryGetSSHPublicKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SSHPublicKeyId !== undefined && input . SSHPublicKeyId !== null ) { entries [ "SSHPublicKeyId" ] = input . SSHPublicKeyId ; } if ( input . Encoding !== undefined && input . Encoding !== null ) { entries [ "Encoding" ] = input . Encoding ; } return entries ; } ; const serializeAws_queryGetUserPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } return entries ; } ; const serializeAws_queryGetUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryListAccessKeysRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListAccountAliasesRequest = ( input , context ) : any => { const entries = { } ; if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListAttachedGroupPoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListAttachedRolePoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListAttachedUserPoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListEntitiesForPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . EntityFilter !== undefined && input . EntityFilter !== null ) { entries [ "EntityFilter" ] = input . EntityFilter ; } if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . PolicyUsageFilter !== undefined && input . PolicyUsageFilter !== null ) { entries [ "PolicyUsageFilter" ] = input . PolicyUsageFilter ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListGroupPoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListGroupsForUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListGroupsRequest = ( input , context ) : any => { const entries = { } ; if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListInstanceProfilesForRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListInstanceProfilesRequest = ( input , context ) : any => { const entries = { } ; if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListInstanceProfileTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListMFADevicesRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListMFADeviceTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListOpenIDConnectProvidersRequest = ( input , context ) : any => { const entries = { } ; return entries ; } ; const serializeAws_queryListOpenIDConnectProviderTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListPoliciesGrantingServiceAccessRequest = ( input , context ) : any => { const entries = { } ; if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . Arn !== undefined && input . Arn !== null ) { entries [ "Arn" ] = input . Arn ; } if ( input . ServiceNamespaces !== undefined && input . ServiceNamespaces !== null ) { const memberEntries = serializeAws_queryserviceNamespaceListType ( input . ServiceNamespaces , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ServiceNamespaces.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryListPoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . Scope !== undefined && input . Scope !== null ) { entries [ "Scope" ] = input . Scope ; } if ( input . OnlyAttached !== undefined && input . OnlyAttached !== null ) { entries [ "OnlyAttached" ] = input . OnlyAttached ; } if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . PolicyUsageFilter !== undefined && input . PolicyUsageFilter !== null ) { entries [ "PolicyUsageFilter" ] = input . PolicyUsageFilter ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListPolicyTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListPolicyVersionsRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListRolePoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListRolesRequest = ( input , context ) : any => { const entries = { } ; if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListRoleTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListSAMLProvidersRequest = ( input , context ) : any => { const entries = { } ; return entries ; } ; const serializeAws_queryListSAMLProviderTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListServerCertificatesRequest = ( input , context ) : any => { const entries = { } ; if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListServerCertificateTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListServiceSpecificCredentialsRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . ServiceName !== undefined && input . ServiceName !== null ) { entries [ "ServiceName" ] = input . ServiceName ; } return entries ; } ; const serializeAws_queryListSigningCertificatesRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListSSHPublicKeysRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListUserPoliciesRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListUsersRequest = ( input , context ) : any => { const entries = { } ; if ( input . PathPrefix !== undefined && input . PathPrefix !== null ) { entries [ "PathPrefix" ] = input . PathPrefix ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListUserTagsRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryListVirtualMFADevicesRequest = ( input , context ) : any => { const entries = { } ; if ( input . AssignmentStatus !== undefined && input . AssignmentStatus !== null ) { entries [ "AssignmentStatus" ] = input . AssignmentStatus ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } return entries ; } ; const serializeAws_queryPutGroupPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } return entries ; } ; const serializeAws_queryPutRolePermissionsBoundaryRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PermissionsBoundary !== undefined && input . PermissionsBoundary !== null ) { entries [ "PermissionsBoundary" ] = input . PermissionsBoundary ; } return entries ; } ; const serializeAws_queryPutRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } return entries ; } ; const serializeAws_queryPutUserPermissionsBoundaryRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PermissionsBoundary !== undefined && input . PermissionsBoundary !== null ) { entries [ "PermissionsBoundary" ] = input . PermissionsBoundary ; } return entries ; } ; const serializeAws_queryPutUserPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . PolicyName !== undefined && input . PolicyName !== null ) { entries [ "PolicyName" ] = input . PolicyName ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } return entries ; } ; const serializeAws_queryRemoveClientIDFromOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . ClientID !== undefined && input . ClientID !== null ) { entries [ "ClientID" ] = input . ClientID ; } return entries ; } ; const serializeAws_queryRemoveRoleFromInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } return entries ; } ; const serializeAws_queryRemoveUserFromGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } return entries ; } ; const serializeAws_queryResetServiceSpecificCredentialRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . ServiceSpecificCredentialId !== undefined && input . ServiceSpecificCredentialId !== null ) { entries [ "ServiceSpecificCredentialId" ] = input . ServiceSpecificCredentialId ; } return entries ; } ; const serializeAws_queryResourceNameListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryResyncMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } if ( input . AuthenticationCode1 !== undefined && input . AuthenticationCode1 !== null ) { entries [ "AuthenticationCode1" ] = input . AuthenticationCode1 ; } if ( input . AuthenticationCode2 !== undefined && input . AuthenticationCode2 !== null ) { entries [ "AuthenticationCode2" ] = input . AuthenticationCode2 ; } return entries ; } ; const serializeAws_queryserviceNamespaceListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_querySetDefaultPolicyVersionRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . VersionId !== undefined && input . VersionId !== null ) { entries [ "VersionId" ] = input . VersionId ; } return entries ; } ; const serializeAws_querySetSecurityTokenServicePreferencesRequest = ( input , context ) : any => { const entries = { } ; if ( input . GlobalEndpointTokenVersion !== undefined && input . GlobalEndpointTokenVersion !== null ) { entries [ "GlobalEndpointTokenVersion" ] = input . GlobalEndpointTokenVersion ; } return entries ; } ; const serializeAws_querySimulateCustomPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyInputList !== undefined && input . PolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . PermissionsBoundaryPolicyInputList !== undefined && input . PermissionsBoundaryPolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PermissionsBoundaryPolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PermissionsBoundaryPolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ActionNames !== undefined && input . ActionNames !== null ) { const memberEntries = serializeAws_queryActionNameListType ( input . ActionNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ActionNames.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourceArns !== undefined && input . ResourceArns !== null ) { const memberEntries = serializeAws_queryResourceNameListType ( input . ResourceArns , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ResourceArns.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourcePolicy !== undefined && input . ResourcePolicy !== null ) { entries [ "ResourcePolicy" ] = input . ResourcePolicy ; } if ( input . ResourceOwner !== undefined && input . ResourceOwner !== null ) { entries [ "ResourceOwner" ] = input . ResourceOwner ; } if ( input . CallerArn !== undefined && input . CallerArn !== null ) { entries [ "CallerArn" ] = input . CallerArn ; } if ( input . ContextEntries !== undefined && input . ContextEntries !== null ) { const memberEntries = serializeAws_queryContextEntryListType ( input . ContextEntries , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ContextEntries.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourceHandlingOption !== undefined && input . ResourceHandlingOption !== null ) { entries [ "ResourceHandlingOption" ] = input . ResourceHandlingOption ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } return entries ; } ; const serializeAws_querySimulatePrincipalPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicySourceArn !== undefined && input . PolicySourceArn !== null ) { entries [ "PolicySourceArn" ] = input . PolicySourceArn ; } if ( input . PolicyInputList !== undefined && input . PolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . PermissionsBoundaryPolicyInputList !== undefined && input . PermissionsBoundaryPolicyInputList !== null ) { const memberEntries = serializeAws_querySimulationPolicyListType ( input . PermissionsBoundaryPolicyInputList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `PermissionsBoundaryPolicyInputList.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ActionNames !== undefined && input . ActionNames !== null ) { const memberEntries = serializeAws_queryActionNameListType ( input . ActionNames , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ActionNames.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourceArns !== undefined && input . ResourceArns !== null ) { const memberEntries = serializeAws_queryResourceNameListType ( input . ResourceArns , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ResourceArns.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourcePolicy !== undefined && input . ResourcePolicy !== null ) { entries [ "ResourcePolicy" ] = input . ResourcePolicy ; } if ( input . ResourceOwner !== undefined && input . ResourceOwner !== null ) { entries [ "ResourceOwner" ] = input . ResourceOwner ; } if ( input . CallerArn !== undefined && input . CallerArn !== null ) { entries [ "CallerArn" ] = input . CallerArn ; } if ( input . ContextEntries !== undefined && input . ContextEntries !== null ) { const memberEntries = serializeAws_queryContextEntryListType ( input . ContextEntries , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ContextEntries.${ key }` ; entries [ loc ] = value ; } ) ; } if ( input . ResourceHandlingOption !== undefined && input . ResourceHandlingOption !== null ) { entries [ "ResourceHandlingOption" ] = input . ResourceHandlingOption ; } if ( input . MaxItems !== undefined && input . MaxItems !== null ) { entries [ "MaxItems" ] = input . MaxItems ; } if ( input . Marker !== undefined && input . Marker !== null ) { entries [ "Marker" ] = input . Marker ; } return entries ; } ; const serializeAws_querySimulationPolicyListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryTag = ( input , context ) : any => { const entries = { } ; if ( input . Key !== undefined && input . Key !== null ) { entries [ "Key" ] = input . Key ; } if ( input . Value !== undefined && input . Value !== null ) { entries [ "Value" ] = input . Value ; } return entries ; } ; const serializeAws_queryTagInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_querytagKeyListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_querytagListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } const memberEntries = serializeAws_queryTag ( entry , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { entries [ `member.${ counter }.${ key }` ] = value ; } ) ; counter ++ ; } return entries ; } ; const serializeAws_queryTagMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryTagUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_querythumbprintListType = ( input , context ) : any => { const entries = { } ; let counter = 1 ; for ( const entry of input ) { if ( entry === null ) { continue ; } entries [ `member.${ counter }` ] = entry ; counter ++ ; } return entries ; } ; const serializeAws_queryUntagInstanceProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . InstanceProfileName !== undefined && input . InstanceProfileName !== null ) { entries [ "InstanceProfileName" ] = input . InstanceProfileName ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagMFADeviceRequest = ( input , context ) : any => { const entries = { } ; if ( input . SerialNumber !== undefined && input . SerialNumber !== null ) { entries [ "SerialNumber" ] = input . SerialNumber ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagOpenIDConnectProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . PolicyArn !== undefined && input . PolicyArn !== null ) { entries [ "PolicyArn" ] = input . PolicyArn ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUntagUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . TagKeys !== undefined && input . TagKeys !== null ) { const memberEntries = serializeAws_querytagKeyListType ( input . TagKeys , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `TagKeys.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUpdateAccessKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . AccessKeyId !== undefined && input . AccessKeyId !== null ) { entries [ "AccessKeyId" ] = input . AccessKeyId ; } if ( input . Status !== undefined && input . Status !== null ) { entries [ "Status" ] = input . Status ; } return entries ; } ; const serializeAws_queryUpdateAccountPasswordPolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . MinimumPasswordLength !== undefined && input . MinimumPasswordLength !== null ) { entries [ "MinimumPasswordLength" ] = input . MinimumPasswordLength ; } if ( input . RequireSymbols !== undefined && input . RequireSymbols !== null ) { entries [ "RequireSymbols" ] = input . RequireSymbols ; } if ( input . RequireNumbers !== undefined && input . RequireNumbers !== null ) { entries [ "RequireNumbers" ] = input . RequireNumbers ; } if ( input . RequireUppercaseCharacters !== undefined && input . RequireUppercaseCharacters !== null ) { entries [ "RequireUppercaseCharacters" ] = input . RequireUppercaseCharacters ; } if ( input . RequireLowercaseCharacters !== undefined && input . RequireLowercaseCharacters !== null ) { entries [ "RequireLowercaseCharacters" ] = input . RequireLowercaseCharacters ; } if ( input . AllowUsersToChangePassword !== undefined && input . AllowUsersToChangePassword !== null ) { entries [ "AllowUsersToChangePassword" ] = input . AllowUsersToChangePassword ; } if ( input . MaxPasswordAge !== undefined && input . MaxPasswordAge !== null ) { entries [ "MaxPasswordAge" ] = input . MaxPasswordAge ; } if ( input . PasswordReusePrevention !== undefined && input . PasswordReusePrevention !== null ) { entries [ "PasswordReusePrevention" ] = input . PasswordReusePrevention ; } if ( input . HardExpiry !== undefined && input . HardExpiry !== null ) { entries [ "HardExpiry" ] = input . HardExpiry ; } return entries ; } ; const serializeAws_queryUpdateAssumeRolePolicyRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . PolicyDocument !== undefined && input . PolicyDocument !== null ) { entries [ "PolicyDocument" ] = input . PolicyDocument ; } return entries ; } ; const serializeAws_queryUpdateGroupRequest = ( input , context ) : any => { const entries = { } ; if ( input . GroupName !== undefined && input . GroupName !== null ) { entries [ "GroupName" ] = input . GroupName ; } if ( input . NewPath !== undefined && input . NewPath !== null ) { entries [ "NewPath" ] = input . NewPath ; } if ( input . NewGroupName !== undefined && input . NewGroupName !== null ) { entries [ "NewGroupName" ] = input . NewGroupName ; } return entries ; } ; const serializeAws_queryUpdateLoginProfileRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . Password !== undefined && input . Password !== null ) { entries [ "Password" ] = input . Password ; } if ( input . PasswordResetRequired !== undefined && input . PasswordResetRequired !== null ) { entries [ "PasswordResetRequired" ] = input . PasswordResetRequired ; } return entries ; } ; const serializeAws_queryUpdateOpenIDConnectProviderThumbprintRequest = ( input , context ) : any => { const entries = { } ; if ( input . OpenIDConnectProviderArn !== undefined && input . OpenIDConnectProviderArn !== null ) { entries [ "OpenIDConnectProviderArn" ] = input . OpenIDConnectProviderArn ; } if ( input . ThumbprintList !== undefined && input . ThumbprintList !== null ) { const memberEntries = serializeAws_querythumbprintListType ( input . ThumbprintList , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `ThumbprintList.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUpdateRoleDescriptionRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } return entries ; } ; const serializeAws_queryUpdateRoleRequest = ( input , context ) : any => { const entries = { } ; if ( input . RoleName !== undefined && input . RoleName !== null ) { entries [ "RoleName" ] = input . RoleName ; } if ( input . Description !== undefined && input . Description !== null ) { entries [ "Description" ] = input . Description ; } if ( input . MaxSessionDuration !== undefined && input . MaxSessionDuration !== null ) { entries [ "MaxSessionDuration" ] = input . MaxSessionDuration ; } return entries ; } ; const serializeAws_queryUpdateSAMLProviderRequest = ( input , context ) : any => { const entries = { } ; if ( input . SAMLMetadataDocument !== undefined && input . SAMLMetadataDocument !== null ) { entries [ "SAMLMetadataDocument" ] = input . SAMLMetadataDocument ; } if ( input . SAMLProviderArn !== undefined && input . SAMLProviderArn !== null ) { entries [ "SAMLProviderArn" ] = input . SAMLProviderArn ; } return entries ; } ; const serializeAws_queryUpdateServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } if ( input . NewPath !== undefined && input . NewPath !== null ) { entries [ "NewPath" ] = input . NewPath ; } if ( input . NewServerCertificateName !== undefined && input . NewServerCertificateName !== null ) { entries [ "NewServerCertificateName" ] = input . NewServerCertificateName ; } return entries ; } ; const serializeAws_queryUpdateServiceSpecificCredentialRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . ServiceSpecificCredentialId !== undefined && input . ServiceSpecificCredentialId !== null ) { entries [ "ServiceSpecificCredentialId" ] = input . ServiceSpecificCredentialId ; } if ( input . Status !== undefined && input . Status !== null ) { entries [ "Status" ] = input . Status ; } return entries ; } ; const serializeAws_queryUpdateSigningCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . CertificateId !== undefined && input . CertificateId !== null ) { entries [ "CertificateId" ] = input . CertificateId ; } if ( input . Status !== undefined && input . Status !== null ) { entries [ "Status" ] = input . Status ; } return entries ; } ; const serializeAws_queryUpdateSSHPublicKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SSHPublicKeyId !== undefined && input . SSHPublicKeyId !== null ) { entries [ "SSHPublicKeyId" ] = input . SSHPublicKeyId ; } if ( input . Status !== undefined && input . Status !== null ) { entries [ "Status" ] = input . Status ; } return entries ; } ; const serializeAws_queryUpdateUserRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . NewPath !== undefined && input . NewPath !== null ) { entries [ "NewPath" ] = input . NewPath ; } if ( input . NewUserName !== undefined && input . NewUserName !== null ) { entries [ "NewUserName" ] = input . NewUserName ; } return entries ; } ; const serializeAws_queryUploadServerCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . Path !== undefined && input . Path !== null ) { entries [ "Path" ] = input . Path ; } if ( input . ServerCertificateName !== undefined && input . ServerCertificateName !== null ) { entries [ "ServerCertificateName" ] = input . ServerCertificateName ; } if ( input . CertificateBody !== undefined && input . CertificateBody !== null ) { entries [ "CertificateBody" ] = input . CertificateBody ; } if ( input . PrivateKey !== undefined && input . PrivateKey !== null ) { entries [ "PrivateKey" ] = input . PrivateKey ; } if ( input . CertificateChain !== undefined && input . CertificateChain !== null ) { entries [ "CertificateChain" ] = input . CertificateChain ; } if ( input . Tags !== undefined && input . Tags !== null ) { const memberEntries = serializeAws_querytagListType ( input . Tags , context ) ; Object . entries ( memberEntries ) . forEach ( ( [ key , value ] ) => { const loc = `Tags.${ key }` ; entries [ loc ] = value ; } ) ; } return entries ; } ; const serializeAws_queryUploadSigningCertificateRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . CertificateBody !== undefined && input . CertificateBody !== null ) { entries [ "CertificateBody" ] = input . CertificateBody ; } return entries ; } ; const serializeAws_queryUploadSSHPublicKeyRequest = ( input , context ) : any => { const entries = { } ; if ( input . UserName !== undefined && input . UserName !== null ) { entries [ "UserName" ] = input . UserName ; } if ( input . SSHPublicKeyBody !== undefined && input . SSHPublicKeyBody !== null ) { entries [ "SSHPublicKeyBody" ] = input . SSHPublicKeyBody ; } return entries ; } ; const deserializeAws_queryAccessDetail = ( output , context ) : AccessDetail => { const contents = { ServiceName : undefined , ServiceNamespace : undefined , Region : undefined , EntityPath : undefined , LastAuthenticatedTime : undefined , TotalAuthenticatedEntities : undefined , } ; if ( output [ "ServiceName" ] !== undefined ) { contents . ServiceName = __expectString ( output [ "ServiceName" ] ) ; } if ( output [ "ServiceNamespace" ] !== undefined ) { contents . ServiceNamespace = __expectString ( output [ "ServiceNamespace" ] ) ; } if ( output [ "Region" ] !== undefined ) { contents . Region = __expectString ( output [ "Region" ] ) ; } if ( output [ "EntityPath" ] !== undefined ) { contents . EntityPath = __expectString ( output [ "EntityPath" ] ) ; } if ( output [ "LastAuthenticatedTime" ] !== undefined ) { contents . LastAuthenticatedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastAuthenticatedTime" ] ) ) ; } if ( output [ "TotalAuthenticatedEntities" ] !== undefined ) { contents . TotalAuthenticatedEntities = __strictParseInt32 ( output [ "TotalAuthenticatedEntities" ] ) as number ; } return contents ; } ; const deserializeAws_queryAccessDetails = ( output , context ) : AccessDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryAccessDetail ( entry , context ) ; } ) ; } ; const deserializeAws_queryAccessKey = ( output , context ) : AccessKey => { const contents = { UserName : undefined , AccessKeyId : undefined , Status : undefined , SecretAccessKey : undefined , CreateDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "AccessKeyId" ] !== undefined ) { contents . AccessKeyId = __expectString ( output [ "AccessKeyId" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "SecretAccessKey" ] !== undefined ) { contents . SecretAccessKey = __expectString ( output [ "SecretAccessKey" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } return contents ; } ; const deserializeAws_queryAccessKeyLastUsed = ( output , context ) : AccessKeyLastUsed => { const contents = { LastUsedDate : undefined , ServiceName : undefined , Region : undefined , } ; if ( output [ "LastUsedDate" ] !== undefined ) { contents . LastUsedDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastUsedDate" ] ) ) ; } if ( output [ "ServiceName" ] !== undefined ) { contents . ServiceName = __expectString ( output [ "ServiceName" ] ) ; } if ( output [ "Region" ] !== undefined ) { contents . Region = __expectString ( output [ "Region" ] ) ; } return contents ; } ; const deserializeAws_queryAccessKeyMetadata = ( output , context ) : AccessKeyMetadata => { const contents = { UserName : undefined , AccessKeyId : undefined , Status : undefined , CreateDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "AccessKeyId" ] !== undefined ) { contents . AccessKeyId = __expectString ( output [ "AccessKeyId" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } return contents ; } ; const deserializeAws_queryaccessKeyMetadataListType = ( output , context ) : AccessKeyMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryAccessKeyMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_queryaccountAliasListType = ( 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_queryArnListType = ( 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_queryAttachedPermissionsBoundary = ( output , context ) : AttachedPermissionsBoundary => { const contents = { PermissionsBoundaryType : undefined , PermissionsBoundaryArn : undefined , } ; if ( output [ "PermissionsBoundaryType" ] !== undefined ) { contents . PermissionsBoundaryType = __expectString ( output [ "PermissionsBoundaryType" ] ) ; } if ( output [ "PermissionsBoundaryArn" ] !== undefined ) { contents . PermissionsBoundaryArn = __expectString ( output [ "PermissionsBoundaryArn" ] ) ; } return contents ; } ; const deserializeAws_queryattachedPoliciesListType = ( output , context ) : AttachedPolicy [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryAttachedPolicy ( entry , context ) ; } ) ; } ; const deserializeAws_queryAttachedPolicy = ( output , context ) : AttachedPolicy => { const contents = { PolicyName : undefined , PolicyArn : undefined , } ; if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyArn" ] !== undefined ) { contents . PolicyArn = __expectString ( output [ "PolicyArn" ] ) ; } return contents ; } ; const deserializeAws_querycertificateListType = ( output , context ) : SigningCertificate [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_querySigningCertificate ( entry , context ) ; } ) ; } ; const deserializeAws_queryclientIDListType = ( 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_queryConcurrentModificationException = ( output , context ) : ConcurrentModificationException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryContextKeyNamesResultListType = ( 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_queryCreateAccessKeyResponse = ( output , context ) : CreateAccessKeyResponse => { const contents = { AccessKey : undefined , } ; if ( output [ "AccessKey" ] !== undefined ) { contents . AccessKey = deserializeAws_queryAccessKey ( output [ "AccessKey" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateGroupResponse = ( output , context ) : CreateGroupResponse => { const contents = { Group : undefined , } ; if ( output [ "Group" ] !== undefined ) { contents . Group = deserializeAws_queryGroup ( output [ "Group" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateInstanceProfileResponse = ( output , context ) : CreateInstanceProfileResponse => { const contents = { InstanceProfile : undefined , } ; if ( output [ "InstanceProfile" ] !== undefined ) { contents . InstanceProfile = deserializeAws_queryInstanceProfile ( output [ "InstanceProfile" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateLoginProfileResponse = ( output , context ) : CreateLoginProfileResponse => { const contents = { LoginProfile : undefined , } ; if ( output [ "LoginProfile" ] !== undefined ) { contents . LoginProfile = deserializeAws_queryLoginProfile ( output [ "LoginProfile" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateOpenIDConnectProviderResponse = ( output , context ) : CreateOpenIDConnectProviderResponse => { const contents = { OpenIDConnectProviderArn : undefined , Tags : undefined , } ; if ( output [ "OpenIDConnectProviderArn" ] !== undefined ) { contents . OpenIDConnectProviderArn = __expectString ( output [ "OpenIDConnectProviderArn" ] ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryCreatePolicyResponse = ( output , context ) : CreatePolicyResponse => { const contents = { Policy : undefined , } ; if ( output [ "Policy" ] !== undefined ) { contents . Policy = deserializeAws_queryPolicy ( output [ "Policy" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreatePolicyVersionResponse = ( output , context ) : CreatePolicyVersionResponse => { const contents = { PolicyVersion : undefined , } ; if ( output [ "PolicyVersion" ] !== undefined ) { contents . PolicyVersion = deserializeAws_queryPolicyVersion ( output [ "PolicyVersion" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateRoleResponse = ( output , context ) : CreateRoleResponse => { const contents = { Role : undefined , } ; if ( output [ "Role" ] !== undefined ) { contents . Role = deserializeAws_queryRole ( output [ "Role" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateSAMLProviderResponse = ( output , context ) : CreateSAMLProviderResponse => { const contents = { SAMLProviderArn : undefined , Tags : undefined , } ; if ( output [ "SAMLProviderArn" ] !== undefined ) { contents . SAMLProviderArn = __expectString ( output [ "SAMLProviderArn" ] ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryCreateServiceLinkedRoleResponse = ( output , context ) : CreateServiceLinkedRoleResponse => { const contents = { Role : undefined , } ; if ( output [ "Role" ] !== undefined ) { contents . Role = deserializeAws_queryRole ( output [ "Role" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateServiceSpecificCredentialResponse = ( output , context ) : CreateServiceSpecificCredentialResponse => { const contents = { ServiceSpecificCredential : undefined , } ; if ( output [ "ServiceSpecificCredential" ] !== undefined ) { contents . ServiceSpecificCredential = deserializeAws_queryServiceSpecificCredential ( output [ "ServiceSpecificCredential" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateUserResponse = ( output , context ) : CreateUserResponse => { const contents = { User : undefined , } ; if ( output [ "User" ] !== undefined ) { contents . User = deserializeAws_queryUser ( output [ "User" ] , context ) ; } return contents ; } ; const deserializeAws_queryCreateVirtualMFADeviceResponse = ( output , context ) : CreateVirtualMFADeviceResponse => { const contents = { VirtualMFADevice : undefined , } ; if ( output [ "VirtualMFADevice" ] !== undefined ) { contents . VirtualMFADevice = deserializeAws_queryVirtualMFADevice ( output [ "VirtualMFADevice" ] , context ) ; } return contents ; } ; const deserializeAws_queryCredentialReportExpiredException = ( output , context ) : CredentialReportExpiredException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryCredentialReportNotPresentException = ( output , context ) : CredentialReportNotPresentException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryCredentialReportNotReadyException = ( output , context ) : CredentialReportNotReadyException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryDeleteConflictException = ( output , context ) : DeleteConflictException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryDeleteServiceLinkedRoleResponse = ( output , context ) : DeleteServiceLinkedRoleResponse => { const contents = { DeletionTaskId : undefined , } ; if ( output [ "DeletionTaskId" ] !== undefined ) { contents . DeletionTaskId = __expectString ( output [ "DeletionTaskId" ] ) ; } return contents ; } ; const deserializeAws_queryDeletionTaskFailureReasonType = ( output , context ) : DeletionTaskFailureReasonType => { const contents = { Reason : undefined , RoleUsageList : undefined , } ; if ( output [ "Reason" ] !== undefined ) { contents . Reason = __expectString ( output [ "Reason" ] ) ; } if ( output . RoleUsageList === "" ) { contents . RoleUsageList = [ ] ; } if ( output [ "RoleUsageList" ] !== undefined && output [ "RoleUsageList" ] [ "member" ] !== undefined ) { contents . RoleUsageList = deserializeAws_queryRoleUsageListType ( __getArrayIfSingleItem ( output [ "RoleUsageList" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryDuplicateCertificateException = ( output , context ) : DuplicateCertificateException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryDuplicateSSHPublicKeyException = ( output , context ) : DuplicateSSHPublicKeyException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryEntityAlreadyExistsException = ( output , context ) : EntityAlreadyExistsException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryEntityDetails = ( output , context ) : EntityDetails => { const contents = { EntityInfo : undefined , LastAuthenticated : undefined , } ; if ( output [ "EntityInfo" ] !== undefined ) { contents . EntityInfo = deserializeAws_queryEntityInfo ( output [ "EntityInfo" ] , context ) ; } if ( output [ "LastAuthenticated" ] !== undefined ) { contents . LastAuthenticated = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastAuthenticated" ] ) ) ; } return contents ; } ; const deserializeAws_queryentityDetailsListType = ( output , context ) : EntityDetails [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEntityDetails ( entry , context ) ; } ) ; } ; const deserializeAws_queryEntityInfo = ( output , context ) : EntityInfo => { const contents = { Arn : undefined , Name : undefined , Type : undefined , Id : undefined , Path : undefined , } ; if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "Name" ] !== undefined ) { contents . Name = __expectString ( output [ "Name" ] ) ; } if ( output [ "Type" ] !== undefined ) { contents . Type = __expectString ( output [ "Type" ] ) ; } if ( output [ "Id" ] !== undefined ) { contents . Id = __expectString ( output [ "Id" ] ) ; } if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } return contents ; } ; const deserializeAws_queryEntityTemporarilyUnmodifiableException = ( output , context ) : EntityTemporarilyUnmodifiableException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryErrorDetails = ( output , context ) : ErrorDetails => { const contents = { Message : undefined , Code : undefined , } ; if ( output [ "Message" ] !== undefined ) { contents . Message = __expectString ( output [ "Message" ] ) ; } if ( output [ "Code" ] !== undefined ) { contents . Code = __expectString ( output [ "Code" ] ) ; } return contents ; } ; const deserializeAws_queryEvalDecisionDetailsType = ( output , context ) : { [ key ] : PolicyEvaluationDecisionType | string ; } => { return output . reduce ( ( acc , pair ) => { if ( pair [ "value" ] === null ) { return acc ; } return { ... acc , [ pair [ "key" ] ] : __expectString ( pair [ "value" ] ) as any , } ; } , { } ) ; } ; const deserializeAws_queryEvaluationResult = ( output , context ) : EvaluationResult => { const contents = { EvalActionName : undefined , EvalResourceName : undefined , EvalDecision : undefined , MatchedStatements : undefined , MissingContextValues : undefined , OrganizationsDecisionDetail : undefined , PermissionsBoundaryDecisionDetail : undefined , EvalDecisionDetails : undefined , ResourceSpecificResults : undefined , } ; if ( output [ "EvalActionName" ] !== undefined ) { contents . EvalActionName = __expectString ( output [ "EvalActionName" ] ) ; } if ( output [ "EvalResourceName" ] !== undefined ) { contents . EvalResourceName = __expectString ( output [ "EvalResourceName" ] ) ; } if ( output [ "EvalDecision" ] !== undefined ) { contents . EvalDecision = __expectString ( output [ "EvalDecision" ] ) ; } if ( output . MatchedStatements === "" ) { contents . MatchedStatements = [ ] ; } if ( output [ "MatchedStatements" ] !== undefined && output [ "MatchedStatements" ] [ "member" ] !== undefined ) { contents . MatchedStatements = deserializeAws_queryStatementListType ( __getArrayIfSingleItem ( output [ "MatchedStatements" ] [ "member" ] ) , context ) ; } if ( output . MissingContextValues === "" ) { contents . MissingContextValues = [ ] ; } if ( output [ "MissingContextValues" ] !== undefined && output [ "MissingContextValues" ] [ "member" ] !== undefined ) { contents . MissingContextValues = deserializeAws_queryContextKeyNamesResultListType ( __getArrayIfSingleItem ( output [ "MissingContextValues" ] [ "member" ] ) , context ) ; } if ( output [ "OrganizationsDecisionDetail" ] !== undefined ) { contents . OrganizationsDecisionDetail = deserializeAws_queryOrganizationsDecisionDetail ( output [ "OrganizationsDecisionDetail" ] , context ) ; } if ( output [ "PermissionsBoundaryDecisionDetail" ] !== undefined ) { contents . PermissionsBoundaryDecisionDetail = deserializeAws_queryPermissionsBoundaryDecisionDetail ( output [ "PermissionsBoundaryDecisionDetail" ] , context ) ; } if ( output . EvalDecisionDetails === "" ) { contents . EvalDecisionDetails = { } ; } if ( output [ "EvalDecisionDetails" ] !== undefined && output [ "EvalDecisionDetails" ] [ "entry" ] !== undefined ) { contents . EvalDecisionDetails = deserializeAws_queryEvalDecisionDetailsType ( __getArrayIfSingleItem ( output [ "EvalDecisionDetails" ] [ "entry" ] ) , context ) ; } if ( output . ResourceSpecificResults === "" ) { contents . ResourceSpecificResults = [ ] ; } if ( output [ "ResourceSpecificResults" ] !== undefined && output [ "ResourceSpecificResults" ] [ "member" ] !== undefined ) { contents . ResourceSpecificResults = deserializeAws_queryResourceSpecificResultListType ( __getArrayIfSingleItem ( output [ "ResourceSpecificResults" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryEvaluationResultsListType = ( output , context ) : EvaluationResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryEvaluationResult ( entry , context ) ; } ) ; } ; const deserializeAws_queryGenerateCredentialReportResponse = ( output , context ) : GenerateCredentialReportResponse => { const contents = { State : undefined , Description : undefined , } ; if ( output [ "State" ] !== undefined ) { contents . State = __expectString ( output [ "State" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } return contents ; } ; const deserializeAws_queryGenerateOrganizationsAccessReportResponse = ( output , context ) : GenerateOrganizationsAccessReportResponse => { const contents = { JobId : undefined , } ; if ( output [ "JobId" ] !== undefined ) { contents . JobId = __expectString ( output [ "JobId" ] ) ; } return contents ; } ; const deserializeAws_queryGenerateServiceLastAccessedDetailsResponse = ( output , context ) : GenerateServiceLastAccessedDetailsResponse => { const contents = { JobId : undefined , } ; if ( output [ "JobId" ] !== undefined ) { contents . JobId = __expectString ( output [ "JobId" ] ) ; } return contents ; } ; const deserializeAws_queryGetAccessKeyLastUsedResponse = ( output , context ) : GetAccessKeyLastUsedResponse => { const contents = { UserName : undefined , AccessKeyLastUsed : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "AccessKeyLastUsed" ] !== undefined ) { contents . AccessKeyLastUsed = deserializeAws_queryAccessKeyLastUsed ( output [ "AccessKeyLastUsed" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetAccountAuthorizationDetailsResponse = ( output , context ) : GetAccountAuthorizationDetailsResponse => { const contents = { UserDetailList : undefined , GroupDetailList : undefined , RoleDetailList : undefined , Policies : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . UserDetailList === "" ) { contents . UserDetailList = [ ] ; } if ( output [ "UserDetailList" ] !== undefined && output [ "UserDetailList" ] [ "member" ] !== undefined ) { contents . UserDetailList = deserializeAws_queryuserDetailListType ( __getArrayIfSingleItem ( output [ "UserDetailList" ] [ "member" ] ) , context ) ; } if ( output . GroupDetailList === "" ) { contents . GroupDetailList = [ ] ; } if ( output [ "GroupDetailList" ] !== undefined && output [ "GroupDetailList" ] [ "member" ] !== undefined ) { contents . GroupDetailList = deserializeAws_querygroupDetailListType ( __getArrayIfSingleItem ( output [ "GroupDetailList" ] [ "member" ] ) , context ) ; } if ( output . RoleDetailList === "" ) { contents . RoleDetailList = [ ] ; } if ( output [ "RoleDetailList" ] !== undefined && output [ "RoleDetailList" ] [ "member" ] !== undefined ) { contents . RoleDetailList = deserializeAws_queryroleDetailListType ( __getArrayIfSingleItem ( output [ "RoleDetailList" ] [ "member" ] ) , context ) ; } if ( output . Policies === "" ) { contents . Policies = [ ] ; } if ( output [ "Policies" ] !== undefined && output [ "Policies" ] [ "member" ] !== undefined ) { contents . Policies = deserializeAws_queryManagedPolicyDetailListType ( __getArrayIfSingleItem ( output [ "Policies" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryGetAccountPasswordPolicyResponse = ( output , context ) : GetAccountPasswordPolicyResponse => { const contents = { PasswordPolicy : undefined , } ; if ( output [ "PasswordPolicy" ] !== undefined ) { contents . PasswordPolicy = deserializeAws_queryPasswordPolicy ( output [ "PasswordPolicy" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetAccountSummaryResponse = ( output , context ) : GetAccountSummaryResponse => { const contents = { SummaryMap : undefined , } ; if ( output . SummaryMap === "" ) { contents . SummaryMap = { } ; } if ( output [ "SummaryMap" ] !== undefined && output [ "SummaryMap" ] [ "entry" ] !== undefined ) { contents . SummaryMap = deserializeAws_querysummaryMapType ( __getArrayIfSingleItem ( output [ "SummaryMap" ] [ "entry" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryGetContextKeysForPolicyResponse = ( output , context ) : GetContextKeysForPolicyResponse => { const contents = { ContextKeyNames : undefined , } ; if ( output . ContextKeyNames === "" ) { contents . ContextKeyNames = [ ] ; } if ( output [ "ContextKeyNames" ] !== undefined && output [ "ContextKeyNames" ] [ "member" ] !== undefined ) { contents . ContextKeyNames = deserializeAws_queryContextKeyNamesResultListType ( __getArrayIfSingleItem ( output [ "ContextKeyNames" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryGetCredentialReportResponse = ( output , context ) : GetCredentialReportResponse => { const contents = { Content : undefined , ReportFormat : undefined , GeneratedTime : undefined , } ; if ( output [ "Content" ] !== undefined ) { contents . Content = context . base64Decoder ( output [ "Content" ] ) ; } if ( output [ "ReportFormat" ] !== undefined ) { contents . ReportFormat = __expectString ( output [ "ReportFormat" ] ) ; } if ( output [ "GeneratedTime" ] !== undefined ) { contents . GeneratedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "GeneratedTime" ] ) ) ; } return contents ; } ; const deserializeAws_queryGetGroupPolicyResponse = ( output , context ) : GetGroupPolicyResponse => { const contents = { GroupName : undefined , PolicyName : undefined , PolicyDocument : undefined , } ; if ( output [ "GroupName" ] !== undefined ) { contents . GroupName = __expectString ( output [ "GroupName" ] ) ; } if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyDocument" ] !== undefined ) { contents . PolicyDocument = __expectString ( output [ "PolicyDocument" ] ) ; } return contents ; } ; const deserializeAws_queryGetGroupResponse = ( output , context ) : GetGroupResponse => { const contents = { Group : undefined , Users : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output [ "Group" ] !== undefined ) { contents . Group = deserializeAws_queryGroup ( output [ "Group" ] , context ) ; } if ( output . Users === "" ) { contents . Users = [ ] ; } if ( output [ "Users" ] !== undefined && output [ "Users" ] [ "member" ] !== undefined ) { contents . Users = deserializeAws_queryuserListType ( __getArrayIfSingleItem ( output [ "Users" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryGetInstanceProfileResponse = ( output , context ) : GetInstanceProfileResponse => { const contents = { InstanceProfile : undefined , } ; if ( output [ "InstanceProfile" ] !== undefined ) { contents . InstanceProfile = deserializeAws_queryInstanceProfile ( output [ "InstanceProfile" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetLoginProfileResponse = ( output , context ) : GetLoginProfileResponse => { const contents = { LoginProfile : undefined , } ; if ( output [ "LoginProfile" ] !== undefined ) { contents . LoginProfile = deserializeAws_queryLoginProfile ( output [ "LoginProfile" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetOpenIDConnectProviderResponse = ( output , context ) : GetOpenIDConnectProviderResponse => { const contents = { Url : undefined , ClientIDList : undefined , ThumbprintList : undefined , CreateDate : undefined , Tags : undefined , } ; if ( output [ "Url" ] !== undefined ) { contents . Url = __expectString ( output [ "Url" ] ) ; } if ( output . ClientIDList === "" ) { contents . ClientIDList = [ ] ; } if ( output [ "ClientIDList" ] !== undefined && output [ "ClientIDList" ] [ "member" ] !== undefined ) { contents . ClientIDList = deserializeAws_queryclientIDListType ( __getArrayIfSingleItem ( output [ "ClientIDList" ] [ "member" ] ) , context ) ; } if ( output . ThumbprintList === "" ) { contents . ThumbprintList = [ ] ; } if ( output [ "ThumbprintList" ] !== undefined && output [ "ThumbprintList" ] [ "member" ] !== undefined ) { contents . ThumbprintList = deserializeAws_querythumbprintListType ( __getArrayIfSingleItem ( output [ "ThumbprintList" ] [ "member" ] ) , context ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryGetOrganizationsAccessReportResponse = ( output , context ) : GetOrganizationsAccessReportResponse => { const contents = { JobStatus : undefined , JobCreationDate : undefined , JobCompletionDate : undefined , NumberOfServicesAccessible : undefined , NumberOfServicesNotAccessed : undefined , AccessDetails : undefined , IsTruncated : undefined , Marker : undefined , ErrorDetails : undefined , } ; if ( output [ "JobStatus" ] !== undefined ) { contents . JobStatus = __expectString ( output [ "JobStatus" ] ) ; } if ( output [ "JobCreationDate" ] !== undefined ) { contents . JobCreationDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCreationDate" ] ) ) ; } if ( output [ "JobCompletionDate" ] !== undefined ) { contents . JobCompletionDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCompletionDate" ] ) ) ; } if ( output [ "NumberOfServicesAccessible" ] !== undefined ) { contents . NumberOfServicesAccessible = __strictParseInt32 ( output [ "NumberOfServicesAccessible" ] ) as number ; } if ( output [ "NumberOfServicesNotAccessed" ] !== undefined ) { contents . NumberOfServicesNotAccessed = __strictParseInt32 ( output [ "NumberOfServicesNotAccessed" ] ) as number ; } if ( output . AccessDetails === "" ) { contents . AccessDetails = [ ] ; } if ( output [ "AccessDetails" ] !== undefined && output [ "AccessDetails" ] [ "member" ] !== undefined ) { contents . AccessDetails = deserializeAws_queryAccessDetails ( __getArrayIfSingleItem ( output [ "AccessDetails" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "ErrorDetails" ] !== undefined ) { contents . ErrorDetails = deserializeAws_queryErrorDetails ( output [ "ErrorDetails" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetPolicyResponse = ( output , context ) : GetPolicyResponse => { const contents = { Policy : undefined , } ; if ( output [ "Policy" ] !== undefined ) { contents . Policy = deserializeAws_queryPolicy ( output [ "Policy" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetPolicyVersionResponse = ( output , context ) : GetPolicyVersionResponse => { const contents = { PolicyVersion : undefined , } ; if ( output [ "PolicyVersion" ] !== undefined ) { contents . PolicyVersion = deserializeAws_queryPolicyVersion ( output [ "PolicyVersion" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetRolePolicyResponse = ( output , context ) : GetRolePolicyResponse => { const contents = { RoleName : undefined , PolicyName : undefined , PolicyDocument : undefined , } ; if ( output [ "RoleName" ] !== undefined ) { contents . RoleName = __expectString ( output [ "RoleName" ] ) ; } if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyDocument" ] !== undefined ) { contents . PolicyDocument = __expectString ( output [ "PolicyDocument" ] ) ; } return contents ; } ; const deserializeAws_queryGetRoleResponse = ( output , context ) : GetRoleResponse => { const contents = { Role : undefined , } ; if ( output [ "Role" ] !== undefined ) { contents . Role = deserializeAws_queryRole ( output [ "Role" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetSAMLProviderResponse = ( output , context ) : GetSAMLProviderResponse => { const contents = { SAMLMetadataDocument : undefined , CreateDate : undefined , ValidUntil : undefined , Tags : undefined , } ; if ( output [ "SAMLMetadataDocument" ] !== undefined ) { contents . SAMLMetadataDocument = __expectString ( output [ "SAMLMetadataDocument" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "ValidUntil" ] !== undefined ) { contents . ValidUntil = __expectNonNull ( __parseRfc3339DateTime ( output [ "ValidUntil" ] ) ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryGetServerCertificateResponse = ( output , context ) : GetServerCertificateResponse => { const contents = { ServerCertificate : undefined , } ; if ( output [ "ServerCertificate" ] !== undefined ) { contents . ServerCertificate = deserializeAws_queryServerCertificate ( output [ "ServerCertificate" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetServiceLastAccessedDetailsResponse = ( output , context ) : GetServiceLastAccessedDetailsResponse => { const contents = { JobStatus : undefined , JobType : undefined , JobCreationDate : undefined , ServicesLastAccessed : undefined , JobCompletionDate : undefined , IsTruncated : undefined , Marker : undefined , Error : undefined , } ; if ( output [ "JobStatus" ] !== undefined ) { contents . JobStatus = __expectString ( output [ "JobStatus" ] ) ; } if ( output [ "JobType" ] !== undefined ) { contents . JobType = __expectString ( output [ "JobType" ] ) ; } if ( output [ "JobCreationDate" ] !== undefined ) { contents . JobCreationDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCreationDate" ] ) ) ; } if ( output . ServicesLastAccessed === "" ) { contents . ServicesLastAccessed = [ ] ; } if ( output [ "ServicesLastAccessed" ] !== undefined && output [ "ServicesLastAccessed" ] [ "member" ] !== undefined ) { contents . ServicesLastAccessed = deserializeAws_queryServicesLastAccessed ( __getArrayIfSingleItem ( output [ "ServicesLastAccessed" ] [ "member" ] ) , context ) ; } if ( output [ "JobCompletionDate" ] !== undefined ) { contents . JobCompletionDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCompletionDate" ] ) ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "Error" ] !== undefined ) { contents . Error = deserializeAws_queryErrorDetails ( output [ "Error" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetServiceLastAccessedDetailsWithEntitiesResponse = ( output , context ) : GetServiceLastAccessedDetailsWithEntitiesResponse => { const contents = { JobStatus : undefined , JobCreationDate : undefined , JobCompletionDate : undefined , EntityDetailsList : undefined , IsTruncated : undefined , Marker : undefined , Error : undefined , } ; if ( output [ "JobStatus" ] !== undefined ) { contents . JobStatus = __expectString ( output [ "JobStatus" ] ) ; } if ( output [ "JobCreationDate" ] !== undefined ) { contents . JobCreationDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCreationDate" ] ) ) ; } if ( output [ "JobCompletionDate" ] !== undefined ) { contents . JobCompletionDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "JobCompletionDate" ] ) ) ; } if ( output . EntityDetailsList === "" ) { contents . EntityDetailsList = [ ] ; } if ( output [ "EntityDetailsList" ] !== undefined && output [ "EntityDetailsList" ] [ "member" ] !== undefined ) { contents . EntityDetailsList = deserializeAws_queryentityDetailsListType ( __getArrayIfSingleItem ( output [ "EntityDetailsList" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } if ( output [ "Error" ] !== undefined ) { contents . Error = deserializeAws_queryErrorDetails ( output [ "Error" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetServiceLinkedRoleDeletionStatusResponse = ( output , context ) : GetServiceLinkedRoleDeletionStatusResponse => { const contents = { Status : undefined , Reason : undefined , } ; if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "Reason" ] !== undefined ) { contents . Reason = deserializeAws_queryDeletionTaskFailureReasonType ( output [ "Reason" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetSSHPublicKeyResponse = ( output , context ) : GetSSHPublicKeyResponse => { const contents = { SSHPublicKey : undefined , } ; if ( output [ "SSHPublicKey" ] !== undefined ) { contents . SSHPublicKey = deserializeAws_querySSHPublicKey ( output [ "SSHPublicKey" ] , context ) ; } return contents ; } ; const deserializeAws_queryGetUserPolicyResponse = ( output , context ) : GetUserPolicyResponse => { const contents = { UserName : undefined , PolicyName : undefined , PolicyDocument : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyDocument" ] !== undefined ) { contents . PolicyDocument = __expectString ( output [ "PolicyDocument" ] ) ; } return contents ; } ; const deserializeAws_queryGetUserResponse = ( output , context ) : GetUserResponse => { const contents = { User : undefined , } ; if ( output [ "User" ] !== undefined ) { contents . User = deserializeAws_queryUser ( output [ "User" ] , context ) ; } return contents ; } ; const deserializeAws_queryGroup = ( output , context ) : Group => { const contents = { Path : undefined , GroupName : undefined , GroupId : undefined , Arn : undefined , CreateDate : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "GroupName" ] !== undefined ) { contents . GroupName = __expectString ( output [ "GroupName" ] ) ; } if ( output [ "GroupId" ] !== undefined ) { contents . GroupId = __expectString ( output [ "GroupId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } return contents ; } ; const deserializeAws_queryGroupDetail = ( output , context ) : GroupDetail => { const contents = { Path : undefined , GroupName : undefined , GroupId : undefined , Arn : undefined , CreateDate : undefined , GroupPolicyList : undefined , AttachedManagedPolicies : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "GroupName" ] !== undefined ) { contents . GroupName = __expectString ( output [ "GroupName" ] ) ; } if ( output [ "GroupId" ] !== undefined ) { contents . GroupId = __expectString ( output [ "GroupId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output . GroupPolicyList === "" ) { contents . GroupPolicyList = [ ] ; } if ( output [ "GroupPolicyList" ] !== undefined && output [ "GroupPolicyList" ] [ "member" ] !== undefined ) { contents . GroupPolicyList = deserializeAws_querypolicyDetailListType ( __getArrayIfSingleItem ( output [ "GroupPolicyList" ] [ "member" ] ) , context ) ; } if ( output . AttachedManagedPolicies === "" ) { contents . AttachedManagedPolicies = [ ] ; } if ( output [ "AttachedManagedPolicies" ] !== undefined && output [ "AttachedManagedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedManagedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedManagedPolicies" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_querygroupDetailListType = ( output , context ) : GroupDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryGroupDetail ( entry , context ) ; } ) ; } ; const deserializeAws_querygroupListType = ( output , context ) : Group [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryGroup ( entry , context ) ; } ) ; } ; const deserializeAws_querygroupNameListType = ( 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_queryInstanceProfile = ( output , context ) : InstanceProfile => { const contents = { Path : undefined , InstanceProfileName : undefined , InstanceProfileId : undefined , Arn : undefined , CreateDate : undefined , Roles : undefined , Tags : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "InstanceProfileName" ] !== undefined ) { contents . InstanceProfileName = __expectString ( output [ "InstanceProfileName" ] ) ; } if ( output [ "InstanceProfileId" ] !== undefined ) { contents . InstanceProfileId = __expectString ( output [ "InstanceProfileId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output . Roles === "" ) { contents . Roles = [ ] ; } if ( output [ "Roles" ] !== undefined && output [ "Roles" ] [ "member" ] !== undefined ) { contents . Roles = deserializeAws_queryroleListType ( __getArrayIfSingleItem ( output [ "Roles" ] [ "member" ] ) , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryinstanceProfileListType = ( output , context ) : InstanceProfile [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryInstanceProfile ( entry , context ) ; } ) ; } ; const deserializeAws_queryInvalidAuthenticationCodeException = ( output , context ) : InvalidAuthenticationCodeException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryInvalidCertificateException = ( output , context ) : InvalidCertificateException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryInvalidInputException = ( output , context ) : InvalidInputException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryInvalidPublicKeyException = ( output , context ) : InvalidPublicKeyException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryInvalidUserTypeException = ( output , context ) : InvalidUserTypeException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryKeyPairMismatchException = ( output , context ) : KeyPairMismatchException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryLimitExceededException = ( output , context ) : LimitExceededException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryListAccessKeysResponse = ( output , context ) : ListAccessKeysResponse => { const contents = { AccessKeyMetadata : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . AccessKeyMetadata === "" ) { contents . AccessKeyMetadata = [ ] ; } if ( output [ "AccessKeyMetadata" ] !== undefined && output [ "AccessKeyMetadata" ] [ "member" ] !== undefined ) { contents . AccessKeyMetadata = deserializeAws_queryaccessKeyMetadataListType ( __getArrayIfSingleItem ( output [ "AccessKeyMetadata" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListAccountAliasesResponse = ( output , context ) : ListAccountAliasesResponse => { const contents = { AccountAliases : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . AccountAliases === "" ) { contents . AccountAliases = [ ] ; } if ( output [ "AccountAliases" ] !== undefined && output [ "AccountAliases" ] [ "member" ] !== undefined ) { contents . AccountAliases = deserializeAws_queryaccountAliasListType ( __getArrayIfSingleItem ( output [ "AccountAliases" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListAttachedGroupPoliciesResponse = ( output , context ) : ListAttachedGroupPoliciesResponse => { const contents = { AttachedPolicies : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . AttachedPolicies === "" ) { contents . AttachedPolicies = [ ] ; } if ( output [ "AttachedPolicies" ] !== undefined && output [ "AttachedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedPolicies" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListAttachedRolePoliciesResponse = ( output , context ) : ListAttachedRolePoliciesResponse => { const contents = { AttachedPolicies : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . AttachedPolicies === "" ) { contents . AttachedPolicies = [ ] ; } if ( output [ "AttachedPolicies" ] !== undefined && output [ "AttachedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedPolicies" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListAttachedUserPoliciesResponse = ( output , context ) : ListAttachedUserPoliciesResponse => { const contents = { AttachedPolicies : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . AttachedPolicies === "" ) { contents . AttachedPolicies = [ ] ; } if ( output [ "AttachedPolicies" ] !== undefined && output [ "AttachedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedPolicies" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListEntitiesForPolicyResponse = ( output , context ) : ListEntitiesForPolicyResponse => { const contents = { PolicyGroups : undefined , PolicyUsers : undefined , PolicyRoles : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . PolicyGroups === "" ) { contents . PolicyGroups = [ ] ; } if ( output [ "PolicyGroups" ] !== undefined && output [ "PolicyGroups" ] [ "member" ] !== undefined ) { contents . PolicyGroups = deserializeAws_queryPolicyGroupListType ( __getArrayIfSingleItem ( output [ "PolicyGroups" ] [ "member" ] ) , context ) ; } if ( output . PolicyUsers === "" ) { contents . PolicyUsers = [ ] ; } if ( output [ "PolicyUsers" ] !== undefined && output [ "PolicyUsers" ] [ "member" ] !== undefined ) { contents . PolicyUsers = deserializeAws_queryPolicyUserListType ( __getArrayIfSingleItem ( output [ "PolicyUsers" ] [ "member" ] ) , context ) ; } if ( output . PolicyRoles === "" ) { contents . PolicyRoles = [ ] ; } if ( output [ "PolicyRoles" ] !== undefined && output [ "PolicyRoles" ] [ "member" ] !== undefined ) { contents . PolicyRoles = deserializeAws_queryPolicyRoleListType ( __getArrayIfSingleItem ( output [ "PolicyRoles" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListGroupPoliciesResponse = ( output , context ) : ListGroupPoliciesResponse => { const contents = { PolicyNames : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . PolicyNames === "" ) { contents . PolicyNames = [ ] ; } if ( output [ "PolicyNames" ] !== undefined && output [ "PolicyNames" ] [ "member" ] !== undefined ) { contents . PolicyNames = deserializeAws_querypolicyNameListType ( __getArrayIfSingleItem ( output [ "PolicyNames" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListGroupsForUserResponse = ( output , context ) : ListGroupsForUserResponse => { const contents = { Groups : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Groups === "" ) { contents . Groups = [ ] ; } if ( output [ "Groups" ] !== undefined && output [ "Groups" ] [ "member" ] !== undefined ) { contents . Groups = deserializeAws_querygroupListType ( __getArrayIfSingleItem ( output [ "Groups" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListGroupsResponse = ( output , context ) : ListGroupsResponse => { const contents = { Groups : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Groups === "" ) { contents . Groups = [ ] ; } if ( output [ "Groups" ] !== undefined && output [ "Groups" ] [ "member" ] !== undefined ) { contents . Groups = deserializeAws_querygroupListType ( __getArrayIfSingleItem ( output [ "Groups" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListInstanceProfilesForRoleResponse = ( output , context ) : ListInstanceProfilesForRoleResponse => { const contents = { InstanceProfiles : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . InstanceProfiles === "" ) { contents . InstanceProfiles = [ ] ; } if ( output [ "InstanceProfiles" ] !== undefined && output [ "InstanceProfiles" ] [ "member" ] !== undefined ) { contents . InstanceProfiles = deserializeAws_queryinstanceProfileListType ( __getArrayIfSingleItem ( output [ "InstanceProfiles" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListInstanceProfilesResponse = ( output , context ) : ListInstanceProfilesResponse => { const contents = { InstanceProfiles : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . InstanceProfiles === "" ) { contents . InstanceProfiles = [ ] ; } if ( output [ "InstanceProfiles" ] !== undefined && output [ "InstanceProfiles" ] [ "member" ] !== undefined ) { contents . InstanceProfiles = deserializeAws_queryinstanceProfileListType ( __getArrayIfSingleItem ( output [ "InstanceProfiles" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListInstanceProfileTagsResponse = ( output , context ) : ListInstanceProfileTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListMFADevicesResponse = ( output , context ) : ListMFADevicesResponse => { const contents = { MFADevices : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . MFADevices === "" ) { contents . MFADevices = [ ] ; } if ( output [ "MFADevices" ] !== undefined && output [ "MFADevices" ] [ "member" ] !== undefined ) { contents . MFADevices = deserializeAws_querymfaDeviceListType ( __getArrayIfSingleItem ( output [ "MFADevices" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListMFADeviceTagsResponse = ( output , context ) : ListMFADeviceTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListOpenIDConnectProvidersResponse = ( output , context ) : ListOpenIDConnectProvidersResponse => { const contents = { OpenIDConnectProviderList : undefined , } ; if ( output . OpenIDConnectProviderList === "" ) { contents . OpenIDConnectProviderList = [ ] ; } if ( output [ "OpenIDConnectProviderList" ] !== undefined && output [ "OpenIDConnectProviderList" ] [ "member" ] !== undefined ) { contents . OpenIDConnectProviderList = deserializeAws_queryOpenIDConnectProviderListType ( __getArrayIfSingleItem ( output [ "OpenIDConnectProviderList" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryListOpenIDConnectProviderTagsResponse = ( output , context ) : ListOpenIDConnectProviderTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListPoliciesGrantingServiceAccessEntry = ( output , context ) : ListPoliciesGrantingServiceAccessEntry => { const contents = { ServiceNamespace : undefined , Policies : undefined , } ; if ( output [ "ServiceNamespace" ] !== undefined ) { contents . ServiceNamespace = __expectString ( output [ "ServiceNamespace" ] ) ; } if ( output . Policies === "" ) { contents . Policies = [ ] ; } if ( output [ "Policies" ] !== undefined && output [ "Policies" ] [ "member" ] !== undefined ) { contents . Policies = deserializeAws_querypolicyGrantingServiceAccessListType ( __getArrayIfSingleItem ( output [ "Policies" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryListPoliciesGrantingServiceAccessResponse = ( output , context ) : ListPoliciesGrantingServiceAccessResponse => { const contents = { PoliciesGrantingServiceAccess : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . PoliciesGrantingServiceAccess === "" ) { contents . PoliciesGrantingServiceAccess = [ ] ; } if ( output [ "PoliciesGrantingServiceAccess" ] !== undefined && output [ "PoliciesGrantingServiceAccess" ] [ "member" ] !== undefined ) { contents . PoliciesGrantingServiceAccess = deserializeAws_querylistPolicyGrantingServiceAccessResponseListType ( __getArrayIfSingleItem ( output [ "PoliciesGrantingServiceAccess" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListPoliciesResponse = ( output , context ) : ListPoliciesResponse => { const contents = { Policies : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Policies === "" ) { contents . Policies = [ ] ; } if ( output [ "Policies" ] !== undefined && output [ "Policies" ] [ "member" ] !== undefined ) { contents . Policies = deserializeAws_querypolicyListType ( __getArrayIfSingleItem ( output [ "Policies" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_querylistPolicyGrantingServiceAccessResponseListType = ( output , context ) : ListPoliciesGrantingServiceAccessEntry [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryListPoliciesGrantingServiceAccessEntry ( entry , context ) ; } ) ; } ; const deserializeAws_queryListPolicyTagsResponse = ( output , context ) : ListPolicyTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListPolicyVersionsResponse = ( output , context ) : ListPolicyVersionsResponse => { const contents = { Versions : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Versions === "" ) { contents . Versions = [ ] ; } if ( output [ "Versions" ] !== undefined && output [ "Versions" ] [ "member" ] !== undefined ) { contents . Versions = deserializeAws_querypolicyDocumentVersionListType ( __getArrayIfSingleItem ( output [ "Versions" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListRolePoliciesResponse = ( output , context ) : ListRolePoliciesResponse => { const contents = { PolicyNames : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . PolicyNames === "" ) { contents . PolicyNames = [ ] ; } if ( output [ "PolicyNames" ] !== undefined && output [ "PolicyNames" ] [ "member" ] !== undefined ) { contents . PolicyNames = deserializeAws_querypolicyNameListType ( __getArrayIfSingleItem ( output [ "PolicyNames" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListRolesResponse = ( output , context ) : ListRolesResponse => { const contents = { Roles : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Roles === "" ) { contents . Roles = [ ] ; } if ( output [ "Roles" ] !== undefined && output [ "Roles" ] [ "member" ] !== undefined ) { contents . Roles = deserializeAws_queryroleListType ( __getArrayIfSingleItem ( output [ "Roles" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListRoleTagsResponse = ( output , context ) : ListRoleTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListSAMLProvidersResponse = ( output , context ) : ListSAMLProvidersResponse => { const contents = { SAMLProviderList : undefined , } ; if ( output . SAMLProviderList === "" ) { contents . SAMLProviderList = [ ] ; } if ( output [ "SAMLProviderList" ] !== undefined && output [ "SAMLProviderList" ] [ "member" ] !== undefined ) { contents . SAMLProviderList = deserializeAws_querySAMLProviderListType ( __getArrayIfSingleItem ( output [ "SAMLProviderList" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryListSAMLProviderTagsResponse = ( output , context ) : ListSAMLProviderTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListServerCertificatesResponse = ( output , context ) : ListServerCertificatesResponse => { const contents = { ServerCertificateMetadataList : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . ServerCertificateMetadataList === "" ) { contents . ServerCertificateMetadataList = [ ] ; } if ( output [ "ServerCertificateMetadataList" ] !== undefined && output [ "ServerCertificateMetadataList" ] [ "member" ] !== undefined ) { contents . ServerCertificateMetadataList = deserializeAws_queryserverCertificateMetadataListType ( __getArrayIfSingleItem ( output [ "ServerCertificateMetadataList" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListServerCertificateTagsResponse = ( output , context ) : ListServerCertificateTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListServiceSpecificCredentialsResponse = ( output , context ) : ListServiceSpecificCredentialsResponse => { const contents = { ServiceSpecificCredentials : undefined , } ; if ( output . ServiceSpecificCredentials === "" ) { contents . ServiceSpecificCredentials = [ ] ; } if ( output [ "ServiceSpecificCredentials" ] !== undefined && output [ "ServiceSpecificCredentials" ] [ "member" ] !== undefined ) { contents . ServiceSpecificCredentials = deserializeAws_queryServiceSpecificCredentialsListType ( __getArrayIfSingleItem ( output [ "ServiceSpecificCredentials" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryListSigningCertificatesResponse = ( output , context ) : ListSigningCertificatesResponse => { const contents = { Certificates : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Certificates === "" ) { contents . Certificates = [ ] ; } if ( output [ "Certificates" ] !== undefined && output [ "Certificates" ] [ "member" ] !== undefined ) { contents . Certificates = deserializeAws_querycertificateListType ( __getArrayIfSingleItem ( output [ "Certificates" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListSSHPublicKeysResponse = ( output , context ) : ListSSHPublicKeysResponse => { const contents = { SSHPublicKeys : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . SSHPublicKeys === "" ) { contents . SSHPublicKeys = [ ] ; } if ( output [ "SSHPublicKeys" ] !== undefined && output [ "SSHPublicKeys" ] [ "member" ] !== undefined ) { contents . SSHPublicKeys = deserializeAws_querySSHPublicKeyListType ( __getArrayIfSingleItem ( output [ "SSHPublicKeys" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListUserPoliciesResponse = ( output , context ) : ListUserPoliciesResponse => { const contents = { PolicyNames : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . PolicyNames === "" ) { contents . PolicyNames = [ ] ; } if ( output [ "PolicyNames" ] !== undefined && output [ "PolicyNames" ] [ "member" ] !== undefined ) { contents . PolicyNames = deserializeAws_querypolicyNameListType ( __getArrayIfSingleItem ( output [ "PolicyNames" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListUsersResponse = ( output , context ) : ListUsersResponse => { const contents = { Users : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Users === "" ) { contents . Users = [ ] ; } if ( output [ "Users" ] !== undefined && output [ "Users" ] [ "member" ] !== undefined ) { contents . Users = deserializeAws_queryuserListType ( __getArrayIfSingleItem ( output [ "Users" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListUserTagsResponse = ( output , context ) : ListUserTagsResponse => { const contents = { Tags : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryListVirtualMFADevicesResponse = ( output , context ) : ListVirtualMFADevicesResponse => { const contents = { VirtualMFADevices : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . VirtualMFADevices === "" ) { contents . VirtualMFADevices = [ ] ; } if ( output [ "VirtualMFADevices" ] !== undefined && output [ "VirtualMFADevices" ] [ "member" ] !== undefined ) { contents . VirtualMFADevices = deserializeAws_queryvirtualMFADeviceListType ( __getArrayIfSingleItem ( output [ "VirtualMFADevices" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_queryLoginProfile = ( output , context ) : LoginProfile => { const contents = { UserName : undefined , CreateDate : undefined , PasswordResetRequired : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "PasswordResetRequired" ] !== undefined ) { contents . PasswordResetRequired = __parseBoolean ( output [ "PasswordResetRequired" ] ) ; } return contents ; } ; const deserializeAws_queryMalformedCertificateException = ( output , context ) : MalformedCertificateException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryMalformedPolicyDocumentException = ( output , context ) : MalformedPolicyDocumentException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryManagedPolicyDetail = ( output , context ) : ManagedPolicyDetail => { const contents = { PolicyName : undefined , PolicyId : undefined , Arn : undefined , Path : undefined , DefaultVersionId : undefined , AttachmentCount : undefined , PermissionsBoundaryUsageCount : undefined , IsAttachable : undefined , Description : undefined , CreateDate : undefined , UpdateDate : undefined , PolicyVersionList : undefined , } ; if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyId" ] !== undefined ) { contents . PolicyId = __expectString ( output [ "PolicyId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "DefaultVersionId" ] !== undefined ) { contents . DefaultVersionId = __expectString ( output [ "DefaultVersionId" ] ) ; } if ( output [ "AttachmentCount" ] !== undefined ) { contents . AttachmentCount = __strictParseInt32 ( output [ "AttachmentCount" ] ) as number ; } if ( output [ "PermissionsBoundaryUsageCount" ] !== undefined ) { contents . PermissionsBoundaryUsageCount = __strictParseInt32 ( output [ "PermissionsBoundaryUsageCount" ] ) as number ; } if ( output [ "IsAttachable" ] !== undefined ) { contents . IsAttachable = __parseBoolean ( output [ "IsAttachable" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "UpdateDate" ] !== undefined ) { contents . UpdateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UpdateDate" ] ) ) ; } if ( output . PolicyVersionList === "" ) { contents . PolicyVersionList = [ ] ; } if ( output [ "PolicyVersionList" ] !== undefined && output [ "PolicyVersionList" ] [ "member" ] !== undefined ) { contents . PolicyVersionList = deserializeAws_querypolicyDocumentVersionListType ( __getArrayIfSingleItem ( output [ "PolicyVersionList" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryManagedPolicyDetailListType = ( output , context ) : ManagedPolicyDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryManagedPolicyDetail ( entry , context ) ; } ) ; } ; const deserializeAws_queryMFADevice = ( output , context ) : MFADevice => { const contents = { UserName : undefined , SerialNumber : undefined , EnableDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "SerialNumber" ] !== undefined ) { contents . SerialNumber = __expectString ( output [ "SerialNumber" ] ) ; } if ( output [ "EnableDate" ] !== undefined ) { contents . EnableDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "EnableDate" ] ) ) ; } return contents ; } ; const deserializeAws_querymfaDeviceListType = ( output , context ) : MFADevice [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryMFADevice ( entry , context ) ; } ) ; } ; const deserializeAws_queryNoSuchEntityException = ( output , context ) : NoSuchEntityException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryOpenIDConnectProviderListEntry = ( output , context ) : OpenIDConnectProviderListEntry => { const contents = { Arn : undefined , } ; if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } return contents ; } ; const deserializeAws_queryOpenIDConnectProviderListType = ( output , context ) : OpenIDConnectProviderListEntry [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryOpenIDConnectProviderListEntry ( entry , context ) ; } ) ; } ; const deserializeAws_queryOrganizationsDecisionDetail = ( output , context ) : OrganizationsDecisionDetail => { const contents = { AllowedByOrganizations : undefined , } ; if ( output [ "AllowedByOrganizations" ] !== undefined ) { contents . AllowedByOrganizations = __parseBoolean ( output [ "AllowedByOrganizations" ] ) ; } return contents ; } ; const deserializeAws_queryPasswordPolicy = ( output , context ) : PasswordPolicy => { const contents = { MinimumPasswordLength : undefined , RequireSymbols : undefined , RequireNumbers : undefined , RequireUppercaseCharacters : undefined , RequireLowercaseCharacters : undefined , AllowUsersToChangePassword : undefined , ExpirePasswords : undefined , MaxPasswordAge : undefined , PasswordReusePrevention : undefined , HardExpiry : undefined , } ; if ( output [ "MinimumPasswordLength" ] !== undefined ) { contents . MinimumPasswordLength = __strictParseInt32 ( output [ "MinimumPasswordLength" ] ) as number ; } if ( output [ "RequireSymbols" ] !== undefined ) { contents . RequireSymbols = __parseBoolean ( output [ "RequireSymbols" ] ) ; } if ( output [ "RequireNumbers" ] !== undefined ) { contents . RequireNumbers = __parseBoolean ( output [ "RequireNumbers" ] ) ; } if ( output [ "RequireUppercaseCharacters" ] !== undefined ) { contents . RequireUppercaseCharacters = __parseBoolean ( output [ "RequireUppercaseCharacters" ] ) ; } if ( output [ "RequireLowercaseCharacters" ] !== undefined ) { contents . RequireLowercaseCharacters = __parseBoolean ( output [ "RequireLowercaseCharacters" ] ) ; } if ( output [ "AllowUsersToChangePassword" ] !== undefined ) { contents . AllowUsersToChangePassword = __parseBoolean ( output [ "AllowUsersToChangePassword" ] ) ; } if ( output [ "ExpirePasswords" ] !== undefined ) { contents . ExpirePasswords = __parseBoolean ( output [ "ExpirePasswords" ] ) ; } if ( output [ "MaxPasswordAge" ] !== undefined ) { contents . MaxPasswordAge = __strictParseInt32 ( output [ "MaxPasswordAge" ] ) as number ; } if ( output [ "PasswordReusePrevention" ] !== undefined ) { contents . PasswordReusePrevention = __strictParseInt32 ( output [ "PasswordReusePrevention" ] ) as number ; } if ( output [ "HardExpiry" ] !== undefined ) { contents . HardExpiry = __parseBoolean ( output [ "HardExpiry" ] ) ; } return contents ; } ; const deserializeAws_queryPasswordPolicyViolationException = ( output , context ) : PasswordPolicyViolationException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryPermissionsBoundaryDecisionDetail = ( output , context ) : PermissionsBoundaryDecisionDetail => { const contents = { AllowedByPermissionsBoundary : undefined , } ; if ( output [ "AllowedByPermissionsBoundary" ] !== undefined ) { contents . AllowedByPermissionsBoundary = __parseBoolean ( output [ "AllowedByPermissionsBoundary" ] ) ; } return contents ; } ; const deserializeAws_queryPolicy = ( output , context ) : Policy => { const contents = { PolicyName : undefined , PolicyId : undefined , Arn : undefined , Path : undefined , DefaultVersionId : undefined , AttachmentCount : undefined , PermissionsBoundaryUsageCount : undefined , IsAttachable : undefined , Description : undefined , CreateDate : undefined , UpdateDate : undefined , Tags : undefined , } ; if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyId" ] !== undefined ) { contents . PolicyId = __expectString ( output [ "PolicyId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "DefaultVersionId" ] !== undefined ) { contents . DefaultVersionId = __expectString ( output [ "DefaultVersionId" ] ) ; } if ( output [ "AttachmentCount" ] !== undefined ) { contents . AttachmentCount = __strictParseInt32 ( output [ "AttachmentCount" ] ) as number ; } if ( output [ "PermissionsBoundaryUsageCount" ] !== undefined ) { contents . PermissionsBoundaryUsageCount = __strictParseInt32 ( output [ "PermissionsBoundaryUsageCount" ] ) as number ; } if ( output [ "IsAttachable" ] !== undefined ) { contents . IsAttachable = __parseBoolean ( output [ "IsAttachable" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "UpdateDate" ] !== undefined ) { contents . UpdateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UpdateDate" ] ) ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryPolicyDetail = ( output , context ) : PolicyDetail => { const contents = { PolicyName : undefined , PolicyDocument : undefined , } ; if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyDocument" ] !== undefined ) { contents . PolicyDocument = __expectString ( output [ "PolicyDocument" ] ) ; } return contents ; } ; const deserializeAws_querypolicyDetailListType = ( output , context ) : PolicyDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyDetail ( entry , context ) ; } ) ; } ; const deserializeAws_querypolicyDocumentVersionListType = ( output , context ) : PolicyVersion [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyVersion ( entry , context ) ; } ) ; } ; const deserializeAws_queryPolicyEvaluationException = ( output , context ) : PolicyEvaluationException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryPolicyGrantingServiceAccess = ( output , context ) : PolicyGrantingServiceAccess => { const contents = { PolicyName : undefined , PolicyType : undefined , PolicyArn : undefined , EntityType : undefined , EntityName : undefined , } ; if ( output [ "PolicyName" ] !== undefined ) { contents . PolicyName = __expectString ( output [ "PolicyName" ] ) ; } if ( output [ "PolicyType" ] !== undefined ) { contents . PolicyType = __expectString ( output [ "PolicyType" ] ) ; } if ( output [ "PolicyArn" ] !== undefined ) { contents . PolicyArn = __expectString ( output [ "PolicyArn" ] ) ; } if ( output [ "EntityType" ] !== undefined ) { contents . EntityType = __expectString ( output [ "EntityType" ] ) ; } if ( output [ "EntityName" ] !== undefined ) { contents . EntityName = __expectString ( output [ "EntityName" ] ) ; } return contents ; } ; const deserializeAws_querypolicyGrantingServiceAccessListType = ( output , context ) : PolicyGrantingServiceAccess [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyGrantingServiceAccess ( entry , context ) ; } ) ; } ; const deserializeAws_queryPolicyGroup = ( output , context ) : PolicyGroup => { const contents = { GroupName : undefined , GroupId : undefined , } ; if ( output [ "GroupName" ] !== undefined ) { contents . GroupName = __expectString ( output [ "GroupName" ] ) ; } if ( output [ "GroupId" ] !== undefined ) { contents . GroupId = __expectString ( output [ "GroupId" ] ) ; } return contents ; } ; const deserializeAws_queryPolicyGroupListType = ( output , context ) : PolicyGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyGroup ( entry , context ) ; } ) ; } ; const deserializeAws_querypolicyListType = ( output , context ) : Policy [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicy ( entry , context ) ; } ) ; } ; const deserializeAws_querypolicyNameListType = ( 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_queryPolicyNotAttachableException = ( output , context ) : PolicyNotAttachableException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryPolicyRole = ( output , context ) : PolicyRole => { const contents = { RoleName : undefined , RoleId : undefined , } ; if ( output [ "RoleName" ] !== undefined ) { contents . RoleName = __expectString ( output [ "RoleName" ] ) ; } if ( output [ "RoleId" ] !== undefined ) { contents . RoleId = __expectString ( output [ "RoleId" ] ) ; } return contents ; } ; const deserializeAws_queryPolicyRoleListType = ( output , context ) : PolicyRole [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyRole ( entry , context ) ; } ) ; } ; const deserializeAws_queryPolicyUser = ( output , context ) : PolicyUser => { const contents = { UserName : undefined , UserId : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "UserId" ] !== undefined ) { contents . UserId = __expectString ( output [ "UserId" ] ) ; } return contents ; } ; const deserializeAws_queryPolicyUserListType = ( output , context ) : PolicyUser [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryPolicyUser ( entry , context ) ; } ) ; } ; const deserializeAws_queryPolicyVersion = ( output , context ) : PolicyVersion => { const contents = { Document : undefined , VersionId : undefined , IsDefaultVersion : undefined , CreateDate : undefined , } ; if ( output [ "Document" ] !== undefined ) { contents . Document = __expectString ( output [ "Document" ] ) ; } if ( output [ "VersionId" ] !== undefined ) { contents . VersionId = __expectString ( output [ "VersionId" ] ) ; } if ( output [ "IsDefaultVersion" ] !== undefined ) { contents . IsDefaultVersion = __parseBoolean ( output [ "IsDefaultVersion" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } return contents ; } ; const deserializeAws_queryPosition = ( output , context ) : Position => { const contents = { Line : undefined , Column : undefined , } ; if ( output [ "Line" ] !== undefined ) { contents . Line = __strictParseInt32 ( output [ "Line" ] ) as number ; } if ( output [ "Column" ] !== undefined ) { contents . Column = __strictParseInt32 ( output [ "Column" ] ) as number ; } return contents ; } ; const deserializeAws_queryReportGenerationLimitExceededException = ( output , context ) : ReportGenerationLimitExceededException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryResetServiceSpecificCredentialResponse = ( output , context ) : ResetServiceSpecificCredentialResponse => { const contents = { ServiceSpecificCredential : undefined , } ; if ( output [ "ServiceSpecificCredential" ] !== undefined ) { contents . ServiceSpecificCredential = deserializeAws_queryServiceSpecificCredential ( output [ "ServiceSpecificCredential" ] , context ) ; } return contents ; } ; const deserializeAws_queryResourceSpecificResult = ( output , context ) : ResourceSpecificResult => { const contents = { EvalResourceName : undefined , EvalResourceDecision : undefined , MatchedStatements : undefined , MissingContextValues : undefined , EvalDecisionDetails : undefined , PermissionsBoundaryDecisionDetail : undefined , } ; if ( output [ "EvalResourceName" ] !== undefined ) { contents . EvalResourceName = __expectString ( output [ "EvalResourceName" ] ) ; } if ( output [ "EvalResourceDecision" ] !== undefined ) { contents . EvalResourceDecision = __expectString ( output [ "EvalResourceDecision" ] ) ; } if ( output . MatchedStatements === "" ) { contents . MatchedStatements = [ ] ; } if ( output [ "MatchedStatements" ] !== undefined && output [ "MatchedStatements" ] [ "member" ] !== undefined ) { contents . MatchedStatements = deserializeAws_queryStatementListType ( __getArrayIfSingleItem ( output [ "MatchedStatements" ] [ "member" ] ) , context ) ; } if ( output . MissingContextValues === "" ) { contents . MissingContextValues = [ ] ; } if ( output [ "MissingContextValues" ] !== undefined && output [ "MissingContextValues" ] [ "member" ] !== undefined ) { contents . MissingContextValues = deserializeAws_queryContextKeyNamesResultListType ( __getArrayIfSingleItem ( output [ "MissingContextValues" ] [ "member" ] ) , context ) ; } if ( output . EvalDecisionDetails === "" ) { contents . EvalDecisionDetails = { } ; } if ( output [ "EvalDecisionDetails" ] !== undefined && output [ "EvalDecisionDetails" ] [ "entry" ] !== undefined ) { contents . EvalDecisionDetails = deserializeAws_queryEvalDecisionDetailsType ( __getArrayIfSingleItem ( output [ "EvalDecisionDetails" ] [ "entry" ] ) , context ) ; } if ( output [ "PermissionsBoundaryDecisionDetail" ] !== undefined ) { contents . PermissionsBoundaryDecisionDetail = deserializeAws_queryPermissionsBoundaryDecisionDetail ( output [ "PermissionsBoundaryDecisionDetail" ] , context ) ; } return contents ; } ; const deserializeAws_queryResourceSpecificResultListType = ( output , context ) : ResourceSpecificResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryResourceSpecificResult ( entry , context ) ; } ) ; } ; const deserializeAws_queryRole = ( output , context ) : Role => { const contents = { Path : undefined , RoleName : undefined , RoleId : undefined , Arn : undefined , CreateDate : undefined , AssumeRolePolicyDocument : undefined , Description : undefined , MaxSessionDuration : undefined , PermissionsBoundary : undefined , Tags : undefined , RoleLastUsed : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "RoleName" ] !== undefined ) { contents . RoleName = __expectString ( output [ "RoleName" ] ) ; } if ( output [ "RoleId" ] !== undefined ) { contents . RoleId = __expectString ( output [ "RoleId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "AssumeRolePolicyDocument" ] !== undefined ) { contents . AssumeRolePolicyDocument = __expectString ( output [ "AssumeRolePolicyDocument" ] ) ; } if ( output [ "Description" ] !== undefined ) { contents . Description = __expectString ( output [ "Description" ] ) ; } if ( output [ "MaxSessionDuration" ] !== undefined ) { contents . MaxSessionDuration = __strictParseInt32 ( output [ "MaxSessionDuration" ] ) as number ; } if ( output [ "PermissionsBoundary" ] !== undefined ) { contents . PermissionsBoundary = deserializeAws_queryAttachedPermissionsBoundary ( output [ "PermissionsBoundary" ] , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "RoleLastUsed" ] !== undefined ) { contents . RoleLastUsed = deserializeAws_queryRoleLastUsed ( output [ "RoleLastUsed" ] , context ) ; } return contents ; } ; const deserializeAws_queryRoleDetail = ( output , context ) : RoleDetail => { const contents = { Path : undefined , RoleName : undefined , RoleId : undefined , Arn : undefined , CreateDate : undefined , AssumeRolePolicyDocument : undefined , InstanceProfileList : undefined , RolePolicyList : undefined , AttachedManagedPolicies : undefined , PermissionsBoundary : undefined , Tags : undefined , RoleLastUsed : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "RoleName" ] !== undefined ) { contents . RoleName = __expectString ( output [ "RoleName" ] ) ; } if ( output [ "RoleId" ] !== undefined ) { contents . RoleId = __expectString ( output [ "RoleId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "AssumeRolePolicyDocument" ] !== undefined ) { contents . AssumeRolePolicyDocument = __expectString ( output [ "AssumeRolePolicyDocument" ] ) ; } if ( output . InstanceProfileList === "" ) { contents . InstanceProfileList = [ ] ; } if ( output [ "InstanceProfileList" ] !== undefined && output [ "InstanceProfileList" ] [ "member" ] !== undefined ) { contents . InstanceProfileList = deserializeAws_queryinstanceProfileListType ( __getArrayIfSingleItem ( output [ "InstanceProfileList" ] [ "member" ] ) , context ) ; } if ( output . RolePolicyList === "" ) { contents . RolePolicyList = [ ] ; } if ( output [ "RolePolicyList" ] !== undefined && output [ "RolePolicyList" ] [ "member" ] !== undefined ) { contents . RolePolicyList = deserializeAws_querypolicyDetailListType ( __getArrayIfSingleItem ( output [ "RolePolicyList" ] [ "member" ] ) , context ) ; } if ( output . AttachedManagedPolicies === "" ) { contents . AttachedManagedPolicies = [ ] ; } if ( output [ "AttachedManagedPolicies" ] !== undefined && output [ "AttachedManagedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedManagedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedManagedPolicies" ] [ "member" ] ) , context ) ; } if ( output [ "PermissionsBoundary" ] !== undefined ) { contents . PermissionsBoundary = deserializeAws_queryAttachedPermissionsBoundary ( output [ "PermissionsBoundary" ] , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } if ( output [ "RoleLastUsed" ] !== undefined ) { contents . RoleLastUsed = deserializeAws_queryRoleLastUsed ( output [ "RoleLastUsed" ] , context ) ; } return contents ; } ; const deserializeAws_queryroleDetailListType = ( output , context ) : RoleDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryRoleDetail ( entry , context ) ; } ) ; } ; const deserializeAws_queryRoleLastUsed = ( output , context ) : RoleLastUsed => { const contents = { LastUsedDate : undefined , Region : undefined , } ; if ( output [ "LastUsedDate" ] !== undefined ) { contents . LastUsedDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastUsedDate" ] ) ) ; } if ( output [ "Region" ] !== undefined ) { contents . Region = __expectString ( output [ "Region" ] ) ; } return contents ; } ; const deserializeAws_queryroleListType = ( output , context ) : Role [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryRole ( entry , context ) ; } ) ; } ; const deserializeAws_queryRoleUsageListType = ( output , context ) : RoleUsageType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryRoleUsageType ( entry , context ) ; } ) ; } ; const deserializeAws_queryRoleUsageType = ( output , context ) : RoleUsageType => { const contents = { Region : undefined , Resources : undefined , } ; if ( output [ "Region" ] !== undefined ) { contents . Region = __expectString ( output [ "Region" ] ) ; } if ( output . Resources === "" ) { contents . Resources = [ ] ; } if ( output [ "Resources" ] !== undefined && output [ "Resources" ] [ "member" ] !== undefined ) { contents . Resources = deserializeAws_queryArnListType ( __getArrayIfSingleItem ( output [ "Resources" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_querySAMLProviderListEntry = ( output , context ) : SAMLProviderListEntry => { const contents = { Arn : undefined , ValidUntil : undefined , CreateDate : undefined , } ; if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "ValidUntil" ] !== undefined ) { contents . ValidUntil = __expectNonNull ( __parseRfc3339DateTime ( output [ "ValidUntil" ] ) ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } return contents ; } ; const deserializeAws_querySAMLProviderListType = ( output , context ) : SAMLProviderListEntry [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_querySAMLProviderListEntry ( entry , context ) ; } ) ; } ; const deserializeAws_queryServerCertificate = ( output , context ) : ServerCertificate => { const contents = { ServerCertificateMetadata : undefined , CertificateBody : undefined , CertificateChain : undefined , Tags : undefined , } ; if ( output [ "ServerCertificateMetadata" ] !== undefined ) { contents . ServerCertificateMetadata = deserializeAws_queryServerCertificateMetadata ( output [ "ServerCertificateMetadata" ] , context ) ; } if ( output [ "CertificateBody" ] !== undefined ) { contents . CertificateBody = __expectString ( output [ "CertificateBody" ] ) ; } if ( output [ "CertificateChain" ] !== undefined ) { contents . CertificateChain = __expectString ( output [ "CertificateChain" ] ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryServerCertificateMetadata = ( output , context ) : ServerCertificateMetadata => { const contents = { Path : undefined , ServerCertificateName : undefined , ServerCertificateId : undefined , Arn : undefined , UploadDate : undefined , Expiration : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "ServerCertificateName" ] !== undefined ) { contents . ServerCertificateName = __expectString ( output [ "ServerCertificateName" ] ) ; } if ( output [ "ServerCertificateId" ] !== undefined ) { contents . ServerCertificateId = __expectString ( output [ "ServerCertificateId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "UploadDate" ] !== undefined ) { contents . UploadDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UploadDate" ] ) ) ; } if ( output [ "Expiration" ] !== undefined ) { contents . Expiration = __expectNonNull ( __parseRfc3339DateTime ( output [ "Expiration" ] ) ) ; } return contents ; } ; const deserializeAws_queryserverCertificateMetadataListType = ( output , context ) : ServerCertificateMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryServerCertificateMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_queryServiceFailureException = ( output , context ) : ServiceFailureException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryServiceLastAccessed = ( output , context ) : ServiceLastAccessed => { const contents = { ServiceName : undefined , LastAuthenticated : undefined , ServiceNamespace : undefined , LastAuthenticatedEntity : undefined , LastAuthenticatedRegion : undefined , TotalAuthenticatedEntities : undefined , TrackedActionsLastAccessed : undefined , } ; if ( output [ "ServiceName" ] !== undefined ) { contents . ServiceName = __expectString ( output [ "ServiceName" ] ) ; } if ( output [ "LastAuthenticated" ] !== undefined ) { contents . LastAuthenticated = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastAuthenticated" ] ) ) ; } if ( output [ "ServiceNamespace" ] !== undefined ) { contents . ServiceNamespace = __expectString ( output [ "ServiceNamespace" ] ) ; } if ( output [ "LastAuthenticatedEntity" ] !== undefined ) { contents . LastAuthenticatedEntity = __expectString ( output [ "LastAuthenticatedEntity" ] ) ; } if ( output [ "LastAuthenticatedRegion" ] !== undefined ) { contents . LastAuthenticatedRegion = __expectString ( output [ "LastAuthenticatedRegion" ] ) ; } if ( output [ "TotalAuthenticatedEntities" ] !== undefined ) { contents . TotalAuthenticatedEntities = __strictParseInt32 ( output [ "TotalAuthenticatedEntities" ] ) as number ; } if ( output . TrackedActionsLastAccessed === "" ) { contents . TrackedActionsLastAccessed = [ ] ; } if ( output [ "TrackedActionsLastAccessed" ] !== undefined && output [ "TrackedActionsLastAccessed" ] [ "member" ] !== undefined ) { contents . TrackedActionsLastAccessed = deserializeAws_queryTrackedActionsLastAccessed ( __getArrayIfSingleItem ( output [ "TrackedActionsLastAccessed" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryServiceNotSupportedException = ( output , context ) : ServiceNotSupportedException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryServicesLastAccessed = ( output , context ) : ServiceLastAccessed [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryServiceLastAccessed ( entry , context ) ; } ) ; } ; const deserializeAws_queryServiceSpecificCredential = ( output , context ) : ServiceSpecificCredential => { const contents = { CreateDate : undefined , ServiceName : undefined , ServiceUserName : undefined , ServicePassword : undefined , ServiceSpecificCredentialId : undefined , UserName : undefined , Status : undefined , } ; if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "ServiceName" ] !== undefined ) { contents . ServiceName = __expectString ( output [ "ServiceName" ] ) ; } if ( output [ "ServiceUserName" ] !== undefined ) { contents . ServiceUserName = __expectString ( output [ "ServiceUserName" ] ) ; } if ( output [ "ServicePassword" ] !== undefined ) { contents . ServicePassword = __expectString ( output [ "ServicePassword" ] ) ; } if ( output [ "ServiceSpecificCredentialId" ] !== undefined ) { contents . ServiceSpecificCredentialId = __expectString ( output [ "ServiceSpecificCredentialId" ] ) ; } if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } return contents ; } ; const deserializeAws_queryServiceSpecificCredentialMetadata = ( output , context ) : ServiceSpecificCredentialMetadata => { const contents = { UserName : undefined , Status : undefined , ServiceUserName : undefined , CreateDate : undefined , ServiceSpecificCredentialId : undefined , ServiceName : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "ServiceUserName" ] !== undefined ) { contents . ServiceUserName = __expectString ( output [ "ServiceUserName" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "ServiceSpecificCredentialId" ] !== undefined ) { contents . ServiceSpecificCredentialId = __expectString ( output [ "ServiceSpecificCredentialId" ] ) ; } if ( output [ "ServiceName" ] !== undefined ) { contents . ServiceName = __expectString ( output [ "ServiceName" ] ) ; } return contents ; } ; const deserializeAws_queryServiceSpecificCredentialsListType = ( output , context ) : ServiceSpecificCredentialMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryServiceSpecificCredentialMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_querySigningCertificate = ( output , context ) : SigningCertificate => { const contents = { UserName : undefined , CertificateId : undefined , CertificateBody : undefined , Status : undefined , UploadDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "CertificateId" ] !== undefined ) { contents . CertificateId = __expectString ( output [ "CertificateId" ] ) ; } if ( output [ "CertificateBody" ] !== undefined ) { contents . CertificateBody = __expectString ( output [ "CertificateBody" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "UploadDate" ] !== undefined ) { contents . UploadDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UploadDate" ] ) ) ; } return contents ; } ; const deserializeAws_querySimulatePolicyResponse = ( output , context ) : SimulatePolicyResponse => { const contents = { EvaluationResults : undefined , IsTruncated : undefined , Marker : undefined , } ; if ( output . EvaluationResults === "" ) { contents . EvaluationResults = [ ] ; } if ( output [ "EvaluationResults" ] !== undefined && output [ "EvaluationResults" ] [ "member" ] !== undefined ) { contents . EvaluationResults = deserializeAws_queryEvaluationResultsListType ( __getArrayIfSingleItem ( output [ "EvaluationResults" ] [ "member" ] ) , context ) ; } if ( output [ "IsTruncated" ] !== undefined ) { contents . IsTruncated = __parseBoolean ( output [ "IsTruncated" ] ) ; } if ( output [ "Marker" ] !== undefined ) { contents . Marker = __expectString ( output [ "Marker" ] ) ; } return contents ; } ; const deserializeAws_querySSHPublicKey = ( output , context ) : SSHPublicKey => { const contents = { UserName : undefined , SSHPublicKeyId : undefined , Fingerprint : undefined , SSHPublicKeyBody : undefined , Status : undefined , UploadDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "SSHPublicKeyId" ] !== undefined ) { contents . SSHPublicKeyId = __expectString ( output [ "SSHPublicKeyId" ] ) ; } if ( output [ "Fingerprint" ] !== undefined ) { contents . Fingerprint = __expectString ( output [ "Fingerprint" ] ) ; } if ( output [ "SSHPublicKeyBody" ] !== undefined ) { contents . SSHPublicKeyBody = __expectString ( output [ "SSHPublicKeyBody" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "UploadDate" ] !== undefined ) { contents . UploadDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UploadDate" ] ) ) ; } return contents ; } ; const deserializeAws_querySSHPublicKeyListType = ( output , context ) : SSHPublicKeyMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_querySSHPublicKeyMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_querySSHPublicKeyMetadata = ( output , context ) : SSHPublicKeyMetadata => { const contents = { UserName : undefined , SSHPublicKeyId : undefined , Status : undefined , UploadDate : undefined , } ; if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "SSHPublicKeyId" ] !== undefined ) { contents . SSHPublicKeyId = __expectString ( output [ "SSHPublicKeyId" ] ) ; } if ( output [ "Status" ] !== undefined ) { contents . Status = __expectString ( output [ "Status" ] ) ; } if ( output [ "UploadDate" ] !== undefined ) { contents . UploadDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "UploadDate" ] ) ) ; } return contents ; } ; const deserializeAws_queryStatement = ( output , context ) : Statement => { const contents = { SourcePolicyId : undefined , SourcePolicyType : undefined , StartPosition : undefined , EndPosition : undefined , } ; if ( output [ "SourcePolicyId" ] !== undefined ) { contents . SourcePolicyId = __expectString ( output [ "SourcePolicyId" ] ) ; } if ( output [ "SourcePolicyType" ] !== undefined ) { contents . SourcePolicyType = __expectString ( output [ "SourcePolicyType" ] ) ; } if ( output [ "StartPosition" ] !== undefined ) { contents . StartPosition = deserializeAws_queryPosition ( output [ "StartPosition" ] , context ) ; } if ( output [ "EndPosition" ] !== undefined ) { contents . EndPosition = deserializeAws_queryPosition ( output [ "EndPosition" ] , context ) ; } return contents ; } ; const deserializeAws_queryStatementListType = ( output , context ) : Statement [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryStatement ( entry , context ) ; } ) ; } ; const deserializeAws_querysummaryMapType = ( output , context ) : { [ key ] : number ; } => { return output . reduce ( ( acc , pair ) => { if ( pair [ "value" ] === null ) { return acc ; } return { ... acc , [ pair [ "key" ] ] : __strictParseInt32 ( pair [ "value" ] ) as number , } ; } , { } ) ; } ; const deserializeAws_queryTag = ( output , context ) : Tag => { const contents = { Key : undefined , Value : undefined , } ; if ( output [ "Key" ] !== undefined ) { contents . Key = __expectString ( output [ "Key" ] ) ; } if ( output [ "Value" ] !== undefined ) { contents . Value = __expectString ( output [ "Value" ] ) ; } return contents ; } ; const deserializeAws_querytagListType = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryTag ( entry , context ) ; } ) ; } ; const deserializeAws_querythumbprintListType = ( 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_queryTrackedActionLastAccessed = ( output , context ) : TrackedActionLastAccessed => { const contents = { ActionName : undefined , LastAccessedEntity : undefined , LastAccessedTime : undefined , LastAccessedRegion : undefined , } ; if ( output [ "ActionName" ] !== undefined ) { contents . ActionName = __expectString ( output [ "ActionName" ] ) ; } if ( output [ "LastAccessedEntity" ] !== undefined ) { contents . LastAccessedEntity = __expectString ( output [ "LastAccessedEntity" ] ) ; } if ( output [ "LastAccessedTime" ] !== undefined ) { contents . LastAccessedTime = __expectNonNull ( __parseRfc3339DateTime ( output [ "LastAccessedTime" ] ) ) ; } if ( output [ "LastAccessedRegion" ] !== undefined ) { contents . LastAccessedRegion = __expectString ( output [ "LastAccessedRegion" ] ) ; } return contents ; } ; const deserializeAws_queryTrackedActionsLastAccessed = ( output , context ) : TrackedActionLastAccessed [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryTrackedActionLastAccessed ( entry , context ) ; } ) ; } ; const deserializeAws_queryUnmodifiableEntityException = ( output , context ) : UnmodifiableEntityException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryUnrecognizedPublicKeyEncodingException = ( output , context ) : UnrecognizedPublicKeyEncodingException => { const contents = { message : undefined , } ; if ( output [ "message" ] !== undefined ) { contents . message = __expectString ( output [ "message" ] ) ; } return contents ; } ; const deserializeAws_queryUpdateRoleDescriptionResponse = ( output , context ) : UpdateRoleDescriptionResponse => { const contents = { Role : undefined , } ; if ( output [ "Role" ] !== undefined ) { contents . Role = deserializeAws_queryRole ( output [ "Role" ] , context ) ; } return contents ; } ; const deserializeAws_queryUpdateRoleResponse = ( output , context ) : UpdateRoleResponse => { const contents = { } ; return contents ; } ; const deserializeAws_queryUpdateSAMLProviderResponse = ( output , context ) : UpdateSAMLProviderResponse => { const contents = { SAMLProviderArn : undefined , } ; if ( output [ "SAMLProviderArn" ] !== undefined ) { contents . SAMLProviderArn = __expectString ( output [ "SAMLProviderArn" ] ) ; } return contents ; } ; const deserializeAws_queryUploadServerCertificateResponse = ( output , context ) : UploadServerCertificateResponse => { const contents = { ServerCertificateMetadata : undefined , Tags : undefined , } ; if ( output [ "ServerCertificateMetadata" ] !== undefined ) { contents . ServerCertificateMetadata = deserializeAws_queryServerCertificateMetadata ( output [ "ServerCertificateMetadata" ] , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryUploadSigningCertificateResponse = ( output , context ) : UploadSigningCertificateResponse => { const contents = { Certificate : undefined , } ; if ( output [ "Certificate" ] !== undefined ) { contents . Certificate = deserializeAws_querySigningCertificate ( output [ "Certificate" ] , context ) ; } return contents ; } ; const deserializeAws_queryUploadSSHPublicKeyResponse = ( output , context ) : UploadSSHPublicKeyResponse => { const contents = { SSHPublicKey : undefined , } ; if ( output [ "SSHPublicKey" ] !== undefined ) { contents . SSHPublicKey = deserializeAws_querySSHPublicKey ( output [ "SSHPublicKey" ] , context ) ; } return contents ; } ; const deserializeAws_queryUser = ( output , context ) : User => { const contents = { Path : undefined , UserName : undefined , UserId : undefined , Arn : undefined , CreateDate : undefined , PasswordLastUsed : undefined , PermissionsBoundary : undefined , Tags : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "UserId" ] !== undefined ) { contents . UserId = __expectString ( output [ "UserId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output [ "PasswordLastUsed" ] !== undefined ) { contents . PasswordLastUsed = __expectNonNull ( __parseRfc3339DateTime ( output [ "PasswordLastUsed" ] ) ) ; } if ( output [ "PermissionsBoundary" ] !== undefined ) { contents . PermissionsBoundary = deserializeAws_queryAttachedPermissionsBoundary ( output [ "PermissionsBoundary" ] , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryUserDetail = ( output , context ) : UserDetail => { const contents = { Path : undefined , UserName : undefined , UserId : undefined , Arn : undefined , CreateDate : undefined , UserPolicyList : undefined , GroupList : undefined , AttachedManagedPolicies : undefined , PermissionsBoundary : undefined , Tags : undefined , } ; if ( output [ "Path" ] !== undefined ) { contents . Path = __expectString ( output [ "Path" ] ) ; } if ( output [ "UserName" ] !== undefined ) { contents . UserName = __expectString ( output [ "UserName" ] ) ; } if ( output [ "UserId" ] !== undefined ) { contents . UserId = __expectString ( output [ "UserId" ] ) ; } if ( output [ "Arn" ] !== undefined ) { contents . Arn = __expectString ( output [ "Arn" ] ) ; } if ( output [ "CreateDate" ] !== undefined ) { contents . CreateDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "CreateDate" ] ) ) ; } if ( output . UserPolicyList === "" ) { contents . UserPolicyList = [ ] ; } if ( output [ "UserPolicyList" ] !== undefined && output [ "UserPolicyList" ] [ "member" ] !== undefined ) { contents . UserPolicyList = deserializeAws_querypolicyDetailListType ( __getArrayIfSingleItem ( output [ "UserPolicyList" ] [ "member" ] ) , context ) ; } if ( output . GroupList === "" ) { contents . GroupList = [ ] ; } if ( output [ "GroupList" ] !== undefined && output [ "GroupList" ] [ "member" ] !== undefined ) { contents . GroupList = deserializeAws_querygroupNameListType ( __getArrayIfSingleItem ( output [ "GroupList" ] [ "member" ] ) , context ) ; } if ( output . AttachedManagedPolicies === "" ) { contents . AttachedManagedPolicies = [ ] ; } if ( output [ "AttachedManagedPolicies" ] !== undefined && output [ "AttachedManagedPolicies" ] [ "member" ] !== undefined ) { contents . AttachedManagedPolicies = deserializeAws_queryattachedPoliciesListType ( __getArrayIfSingleItem ( output [ "AttachedManagedPolicies" ] [ "member" ] ) , context ) ; } if ( output [ "PermissionsBoundary" ] !== undefined ) { contents . PermissionsBoundary = deserializeAws_queryAttachedPermissionsBoundary ( output [ "PermissionsBoundary" ] , context ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryuserDetailListType = ( output , context ) : UserDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryUserDetail ( entry , context ) ; } ) ; } ; const deserializeAws_queryuserListType = ( output , context ) : User [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryUser ( entry , context ) ; } ) ; } ; const deserializeAws_queryVirtualMFADevice = ( output , context ) : VirtualMFADevice => { const contents = { SerialNumber : undefined , Base32StringSeed : undefined , QRCodePNG : undefined , User : undefined , EnableDate : undefined , Tags : undefined , } ; if ( output [ "SerialNumber" ] !== undefined ) { contents . SerialNumber = __expectString ( output [ "SerialNumber" ] ) ; } if ( output [ "Base32StringSeed" ] !== undefined ) { contents . Base32StringSeed = context . base64Decoder ( output [ "Base32StringSeed" ] ) ; } if ( output [ "QRCodePNG" ] !== undefined ) { contents . QRCodePNG = context . base64Decoder ( output [ "QRCodePNG" ] ) ; } if ( output [ "User" ] !== undefined ) { contents . User = deserializeAws_queryUser ( output [ "User" ] , context ) ; } if ( output [ "EnableDate" ] !== undefined ) { contents . EnableDate = __expectNonNull ( __parseRfc3339DateTime ( output [ "EnableDate" ] ) ) ; } if ( output . Tags === "" ) { contents . Tags = [ ] ; } if ( output [ "Tags" ] !== undefined && output [ "Tags" ] [ "member" ] !== undefined ) { contents . Tags = deserializeAws_querytagListType ( __getArrayIfSingleItem ( output [ "Tags" ] [ "member" ] ) , context ) ; } return contents ; } ; const deserializeAws_queryvirtualMFADeviceListType = ( output , context ) : VirtualMFADevice [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_queryVirtualMFADevice ( entry , context ) ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { const parsedObj = xmlParse ( encoded , { attributeNamePrefix : "" , ignoreAttributes : false , parseNodeValue : false , trimValues : false , tagValueProcessor : ( val ) => ( val . trim ( ) === "" && val . includes ( "\n" ) ? "" : decodeHTML ( val ) ) , } ) ; const textNodeName = "#text" ; const key = Object . keys ( parsedObj ) [ 0 ] ; const parsedObjToReturn = parsedObj [ key ] ; if ( parsedObjToReturn [ textNodeName ] ) { parsedObjToReturn [ key ] = parsedObjToReturn [ textNodeName ] ; delete parsedObjToReturn [ textNodeName ] ; } return __getValueFromTextNode ( parsedObjToReturn ) ; } return { } ; } ) ; const buildFormUrlencodedString = ( formEntries ) : string => Object . entries ( formEntries ) . map ( ( [ key , value ] ) => __extendedEncodeURIComponent ( key ) + "=" + __extendedEncodeURIComponent ( value ) ) . join ( "&" ) ; const loadQueryErrorCode = ( output , data ) : string => { if ( data . Error . Code !== undefined ) { return data . Error . Code ; } if ( output . statusCode == 404 ) { return "NotFound" ; } return "" ; } ;