import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { AttachManagedPolicyToPermissionSetCommandInput , AttachManagedPolicyToPermissionSetCommandOutput , } from "../commands/AttachManagedPolicyToPermissionSetCommand" ; import { CreateAccountAssignmentCommandInput , CreateAccountAssignmentCommandOutput , } from "../commands/CreateAccountAssignmentCommand" ; import { CreateInstanceAccessControlAttributeConfigurationCommandInput , CreateInstanceAccessControlAttributeConfigurationCommandOutput , } from "../commands/CreateInstanceAccessControlAttributeConfigurationCommand" ; import { CreatePermissionSetCommandInput , CreatePermissionSetCommandOutput , } from "../commands/CreatePermissionSetCommand" ; import { DeleteAccountAssignmentCommandInput , DeleteAccountAssignmentCommandOutput , } from "../commands/DeleteAccountAssignmentCommand" ; import { DeleteInlinePolicyFromPermissionSetCommandInput , DeleteInlinePolicyFromPermissionSetCommandOutput , } from "../commands/DeleteInlinePolicyFromPermissionSetCommand" ; import { DeleteInstanceAccessControlAttributeConfigurationCommandInput , DeleteInstanceAccessControlAttributeConfigurationCommandOutput , } from "../commands/DeleteInstanceAccessControlAttributeConfigurationCommand" ; import { DeletePermissionSetCommandInput , DeletePermissionSetCommandOutput , } from "../commands/DeletePermissionSetCommand" ; import { DescribeAccountAssignmentCreationStatusCommandInput , DescribeAccountAssignmentCreationStatusCommandOutput , } from "../commands/DescribeAccountAssignmentCreationStatusCommand" ; import { DescribeAccountAssignmentDeletionStatusCommandInput , DescribeAccountAssignmentDeletionStatusCommandOutput , } from "../commands/DescribeAccountAssignmentDeletionStatusCommand" ; import { DescribeInstanceAccessControlAttributeConfigurationCommandInput , DescribeInstanceAccessControlAttributeConfigurationCommandOutput , } from "../commands/DescribeInstanceAccessControlAttributeConfigurationCommand" ; import { DescribePermissionSetCommandInput , DescribePermissionSetCommandOutput , } from "../commands/DescribePermissionSetCommand" ; import { DescribePermissionSetProvisioningStatusCommandInput , DescribePermissionSetProvisioningStatusCommandOutput , } from "../commands/DescribePermissionSetProvisioningStatusCommand" ; import { DetachManagedPolicyFromPermissionSetCommandInput , DetachManagedPolicyFromPermissionSetCommandOutput , } from "../commands/DetachManagedPolicyFromPermissionSetCommand" ; import { GetInlinePolicyForPermissionSetCommandInput , GetInlinePolicyForPermissionSetCommandOutput , } from "../commands/GetInlinePolicyForPermissionSetCommand" ; import { ListAccountAssignmentCreationStatusCommandInput , ListAccountAssignmentCreationStatusCommandOutput , } from "../commands/ListAccountAssignmentCreationStatusCommand" ; import { ListAccountAssignmentDeletionStatusCommandInput , ListAccountAssignmentDeletionStatusCommandOutput , } from "../commands/ListAccountAssignmentDeletionStatusCommand" ; import { ListAccountAssignmentsCommandInput , ListAccountAssignmentsCommandOutput , } from "../commands/ListAccountAssignmentsCommand" ; import { ListAccountsForProvisionedPermissionSetCommandInput , ListAccountsForProvisionedPermissionSetCommandOutput , } from "../commands/ListAccountsForProvisionedPermissionSetCommand" ; import { ListInstancesCommandInput , ListInstancesCommandOutput } from "../commands/ListInstancesCommand" ; import { ListManagedPoliciesInPermissionSetCommandInput , ListManagedPoliciesInPermissionSetCommandOutput , } from "../commands/ListManagedPoliciesInPermissionSetCommand" ; import { ListPermissionSetProvisioningStatusCommandInput , ListPermissionSetProvisioningStatusCommandOutput , } from "../commands/ListPermissionSetProvisioningStatusCommand" ; import { ListPermissionSetsCommandInput , ListPermissionSetsCommandOutput } from "../commands/ListPermissionSetsCommand" ; import { ListPermissionSetsProvisionedToAccountCommandInput , ListPermissionSetsProvisionedToAccountCommandOutput , } from "../commands/ListPermissionSetsProvisionedToAccountCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { ProvisionPermissionSetCommandInput , ProvisionPermissionSetCommandOutput , } from "../commands/ProvisionPermissionSetCommand" ; import { PutInlinePolicyToPermissionSetCommandInput , PutInlinePolicyToPermissionSetCommandOutput , } from "../commands/PutInlinePolicyToPermissionSetCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateInstanceAccessControlAttributeConfigurationCommandInput , UpdateInstanceAccessControlAttributeConfigurationCommandOutput , } from "../commands/UpdateInstanceAccessControlAttributeConfigurationCommand" ; import { UpdatePermissionSetCommandInput , UpdatePermissionSetCommandOutput , } from "../commands/UpdatePermissionSetCommand" ; import { AccessControlAttribute , AccessControlAttributeValue , AccessDeniedException , AccountAssignment , AccountAssignmentOperationStatus , AccountAssignmentOperationStatusMetadata , AttachedManagedPolicy , AttachManagedPolicyToPermissionSetRequest , AttachManagedPolicyToPermissionSetResponse , ConflictException , CreateAccountAssignmentRequest , CreateAccountAssignmentResponse , CreateInstanceAccessControlAttributeConfigurationRequest , CreateInstanceAccessControlAttributeConfigurationResponse , CreatePermissionSetRequest , CreatePermissionSetResponse , DeleteAccountAssignmentRequest , DeleteAccountAssignmentResponse , DeleteInlinePolicyFromPermissionSetRequest , DeleteInlinePolicyFromPermissionSetResponse , DeleteInstanceAccessControlAttributeConfigurationRequest , DeleteInstanceAccessControlAttributeConfigurationResponse , DeletePermissionSetRequest , DeletePermissionSetResponse , DescribeAccountAssignmentCreationStatusRequest , DescribeAccountAssignmentCreationStatusResponse , DescribeAccountAssignmentDeletionStatusRequest , DescribeAccountAssignmentDeletionStatusResponse , DescribeInstanceAccessControlAttributeConfigurationRequest , DescribeInstanceAccessControlAttributeConfigurationResponse , DescribePermissionSetProvisioningStatusRequest , DescribePermissionSetProvisioningStatusResponse , DescribePermissionSetRequest , DescribePermissionSetResponse , DetachManagedPolicyFromPermissionSetRequest , DetachManagedPolicyFromPermissionSetResponse , GetInlinePolicyForPermissionSetRequest , GetInlinePolicyForPermissionSetResponse , InstanceAccessControlAttributeConfiguration , InstanceMetadata , InternalServerException , ListAccountAssignmentCreationStatusRequest , ListAccountAssignmentCreationStatusResponse , ListAccountAssignmentDeletionStatusRequest , ListAccountAssignmentDeletionStatusResponse , ListAccountAssignmentsRequest , ListAccountAssignmentsResponse , ListAccountsForProvisionedPermissionSetRequest , ListAccountsForProvisionedPermissionSetResponse , ListInstancesRequest , ListInstancesResponse , ListManagedPoliciesInPermissionSetRequest , ListManagedPoliciesInPermissionSetResponse , ListPermissionSetProvisioningStatusRequest , ListPermissionSetProvisioningStatusResponse , ListPermissionSetsProvisionedToAccountRequest , ListPermissionSetsProvisionedToAccountResponse , ListPermissionSetsRequest , ListPermissionSetsResponse , ListTagsForResourceRequest , ListTagsForResourceResponse , OperationStatusFilter , PermissionSet , PermissionSetProvisioningStatus , PermissionSetProvisioningStatusMetadata , ProvisionPermissionSetRequest , ProvisionPermissionSetResponse , PutInlinePolicyToPermissionSetRequest , PutInlinePolicyToPermissionSetResponse , ResourceNotFoundException , ServiceQuotaExceededException , Tag , TagResourceRequest , TagResourceResponse , ThrottlingException , UntagResourceRequest , UntagResourceResponse , UpdateInstanceAccessControlAttributeConfigurationRequest , UpdateInstanceAccessControlAttributeConfigurationResponse , UpdatePermissionSetRequest , UpdatePermissionSetResponse , ValidationException , } from "../models/models_0" ; export const serializeAws_json1_1AttachManagedPolicyToPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.AttachManagedPolicyToPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AttachManagedPolicyToPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateAccountAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.CreateAccountAssignment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateAccountAssignmentRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.CreateInstanceAccessControlAttributeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreatePermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.CreatePermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreatePermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteAccountAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DeleteAccountAssignment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteAccountAssignmentRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DeleteInlinePolicyFromPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteInlinePolicyFromPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DeleteInstanceAccessControlAttributeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeletePermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DeletePermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeletePermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAccountAssignmentCreationStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DescribeAccountAssignmentCreationStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAccountAssignmentCreationStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DescribeAccountAssignmentDeletionStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAccountAssignmentDeletionStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DescribeInstanceAccessControlAttributeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribePermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DescribePermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribePermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribePermissionSetProvisioningStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DescribePermissionSetProvisioningStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribePermissionSetProvisioningStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DetachManagedPolicyFromPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.DetachManagedPolicyFromPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DetachManagedPolicyFromPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetInlinePolicyForPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.GetInlinePolicyForPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetInlinePolicyForPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAccountAssignmentCreationStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListAccountAssignmentCreationStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAccountAssignmentCreationStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAccountAssignmentDeletionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListAccountAssignmentDeletionStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAccountAssignmentDeletionStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAccountAssignmentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListAccountAssignments" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAccountAssignmentsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListAccountsForProvisionedPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAccountsForProvisionedPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListInstancesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListInstances" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListInstancesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListManagedPoliciesInPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListManagedPoliciesInPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListManagedPoliciesInPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListPermissionSetProvisioningStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListPermissionSetProvisioningStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListPermissionSetProvisioningStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListPermissionSetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListPermissionSets" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListPermissionSetsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListPermissionSetsProvisionedToAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListPermissionSetsProvisionedToAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ProvisionPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.ProvisionPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ProvisionPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutInlinePolicyToPermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.PutInlinePolicyToPermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutInlinePolicyToPermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.UpdateInstanceAccessControlAttributeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdatePermissionSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "SWBExternalService.UpdatePermissionSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdatePermissionSetRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommand = async ( output , context ) : Promise < AttachManagedPolicyToPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AttachManagedPolicyToPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AttachManagedPolicyToPermissionSetCommandError = async ( output , context ) : Promise < AttachManagedPolicyToPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.ssoadmin#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateAccountAssignmentCommand = async ( output , context ) : Promise < CreateAccountAssignmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateAccountAssignmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateAccountAssignmentResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateAccountAssignmentCommandError = async ( output , context ) : Promise < CreateAccountAssignmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.ssoadmin#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommand = async ( output , context ) : Promise < CreateInstanceAccessControlAttributeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationCommandError = async ( output , context ) : Promise < CreateInstanceAccessControlAttributeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreatePermissionSetCommand = async ( output , context ) : Promise < CreatePermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreatePermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreatePermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreatePermissionSetCommandError = async ( output , context ) : Promise < CreatePermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.ssoadmin#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteAccountAssignmentCommand = async ( output , context ) : Promise < DeleteAccountAssignmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteAccountAssignmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteAccountAssignmentResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteAccountAssignmentCommandError = async ( output , context ) : Promise < DeleteAccountAssignmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommand = async ( output , context ) : Promise < DeleteInlinePolicyFromPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetCommandError = async ( output , context ) : Promise < DeleteInlinePolicyFromPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommand = async ( output , context ) : Promise < DeleteInstanceAccessControlAttributeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationCommandError = async ( output , context ) : Promise < DeleteInstanceAccessControlAttributeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeletePermissionSetCommand = async ( output , context ) : Promise < DeletePermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeletePermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeletePermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeletePermissionSetCommandError = async ( output , context ) : Promise < DeletePermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommand = async ( output , context ) : Promise < DescribeAccountAssignmentCreationStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAccountAssignmentCreationStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAccountAssignmentCreationStatusCommandError = async ( output , context ) : Promise < DescribeAccountAssignmentCreationStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommand = async ( output , context ) : Promise < DescribeAccountAssignmentDeletionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusCommandError = async ( output , context ) : Promise < DescribeAccountAssignmentDeletionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommand = async ( output , context ) : Promise < DescribeInstanceAccessControlAttributeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationCommandError = async ( output , context ) : Promise < DescribeInstanceAccessControlAttributeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribePermissionSetCommand = async ( output , context ) : Promise < DescribePermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribePermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribePermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribePermissionSetCommandError = async ( output , context ) : Promise < DescribePermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommand = async ( output , context ) : Promise < DescribePermissionSetProvisioningStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribePermissionSetProvisioningStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribePermissionSetProvisioningStatusCommandError = async ( output , context ) : Promise < DescribePermissionSetProvisioningStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommand = async ( output , context ) : Promise < DetachManagedPolicyFromPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DetachManagedPolicyFromPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DetachManagedPolicyFromPermissionSetCommandError = async ( output , context ) : Promise < DetachManagedPolicyFromPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetInlinePolicyForPermissionSetCommand = async ( output , context ) : Promise < GetInlinePolicyForPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetInlinePolicyForPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetInlinePolicyForPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetInlinePolicyForPermissionSetCommandError = async ( output , context ) : Promise < GetInlinePolicyForPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAccountAssignmentCreationStatusCommand = async ( output , context ) : Promise < ListAccountAssignmentCreationStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAccountAssignmentCreationStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAccountAssignmentCreationStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAccountAssignmentCreationStatusCommandError = async ( output , context ) : Promise < ListAccountAssignmentCreationStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommand = async ( output , context ) : Promise < ListAccountAssignmentDeletionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAccountAssignmentDeletionStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAccountAssignmentDeletionStatusCommandError = async ( output , context ) : Promise < ListAccountAssignmentDeletionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAccountAssignmentsCommand = async ( output , context ) : Promise < ListAccountAssignmentsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAccountAssignmentsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAccountAssignmentsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAccountAssignmentsCommandError = async ( output , context ) : Promise < ListAccountAssignmentsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommand = async ( output , context ) : Promise < ListAccountsForProvisionedPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAccountsForProvisionedPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAccountsForProvisionedPermissionSetCommandError = async ( output , context ) : Promise < ListAccountsForProvisionedPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListInstancesCommand = async ( output , context ) : Promise < ListInstancesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListInstancesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListInstancesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListInstancesCommandError = async ( output , context ) : Promise < ListInstancesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommand = async ( output , context ) : Promise < ListManagedPoliciesInPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListManagedPoliciesInPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListManagedPoliciesInPermissionSetCommandError = async ( output , context ) : Promise < ListManagedPoliciesInPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListPermissionSetProvisioningStatusCommand = async ( output , context ) : Promise < ListPermissionSetProvisioningStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListPermissionSetProvisioningStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListPermissionSetProvisioningStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListPermissionSetProvisioningStatusCommandError = async ( output , context ) : Promise < ListPermissionSetProvisioningStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListPermissionSetsCommand = async ( output , context ) : Promise < ListPermissionSetsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListPermissionSetsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListPermissionSetsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListPermissionSetsCommandError = async ( output , context ) : Promise < ListPermissionSetsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommand = async ( output , context ) : Promise < ListPermissionSetsProvisionedToAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListPermissionSetsProvisionedToAccountResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListPermissionSetsProvisionedToAccountCommandError = async ( output , context ) : Promise < ListPermissionSetsProvisionedToAccountCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ProvisionPermissionSetCommand = async ( output , context ) : Promise < ProvisionPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ProvisionPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ProvisionPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ProvisionPermissionSetCommandError = async ( output , context ) : Promise < ProvisionPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutInlinePolicyToPermissionSetCommand = async ( output , context ) : Promise < PutInlinePolicyToPermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutInlinePolicyToPermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutInlinePolicyToPermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutInlinePolicyToPermissionSetCommandError = async ( output , context ) : Promise < PutInlinePolicyToPermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.ssoadmin#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.ssoadmin#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UntagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommand = async ( output , context ) : Promise < UpdateInstanceAccessControlAttributeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationCommandError = async ( output , context ) : Promise < UpdateInstanceAccessControlAttributeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdatePermissionSetCommand = async ( output , context ) : Promise < UpdatePermissionSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdatePermissionSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdatePermissionSetResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdatePermissionSetCommandError = async ( output , context ) : Promise < UpdatePermissionSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.ssoadmin#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.ssoadmin#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.ssoadmin#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.ssoadmin#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.ssoadmin#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ssoadmin#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_1AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AccessDeniedException ( body , context ) ; const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConflictException ( body , context ) ; const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InternalServerExceptionResponse = async ( parsedOutput , context ) : Promise < InternalServerException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InternalServerException ( body , context ) ; const contents = { name : "InternalServerException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ServiceQuotaExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceQuotaExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ServiceQuotaExceededException ( body , context ) ; const contents = { name : "ServiceQuotaExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ThrottlingException ( body , context ) ; const contents = { name : "ThrottlingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ValidationExceptionResponse = async ( parsedOutput , context ) : Promise < ValidationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ValidationException ( body , context ) ; const contents = { name : "ValidationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AccessControlAttribute = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : serializeAws_json1_1AccessControlAttributeValue ( input . Value , context ) } ) , } ; } ; const serializeAws_json1_1AccessControlAttributeList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1AccessControlAttribute ( entry , context ) ; } ) ; } ; const serializeAws_json1_1AccessControlAttributeValue = ( input , context ) : any => { return { ... ( input . Source !== undefined && input . Source !== null && { Source : serializeAws_json1_1AccessControlAttributeValueSourceList ( input . Source , context ) , } ) , } ; } ; const serializeAws_json1_1AccessControlAttributeValueSourceList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1AttachManagedPolicyToPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . ManagedPolicyArn !== undefined && input . ManagedPolicyArn !== null && { ManagedPolicyArn : input . ManagedPolicyArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1CreateAccountAssignmentRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , ... ( input . PrincipalId !== undefined && input . PrincipalId !== null && { PrincipalId : input . PrincipalId } ) , ... ( input . PrincipalType !== undefined && input . PrincipalType !== null && { PrincipalType : input . PrincipalType } ) , ... ( input . TargetId !== undefined && input . TargetId !== null && { TargetId : input . TargetId } ) , ... ( input . TargetType !== undefined && input . TargetType !== null && { TargetType : input . TargetType } ) , } ; } ; const serializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationRequest = ( input , context ) : any => { return { ... ( input . InstanceAccessControlAttributeConfiguration !== undefined && input . InstanceAccessControlAttributeConfiguration !== null && { InstanceAccessControlAttributeConfiguration : serializeAws_json1_1InstanceAccessControlAttributeConfiguration ( input . InstanceAccessControlAttributeConfiguration , context ) , } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1CreatePermissionSetRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . RelayState !== undefined && input . RelayState !== null && { RelayState : input . RelayState } ) , ... ( input . SessionDuration !== undefined && input . SessionDuration !== null && { SessionDuration : input . SessionDuration } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1DeleteAccountAssignmentRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , ... ( input . PrincipalId !== undefined && input . PrincipalId !== null && { PrincipalId : input . PrincipalId } ) , ... ( input . PrincipalType !== undefined && input . PrincipalType !== null && { PrincipalType : input . PrincipalType } ) , ... ( input . TargetId !== undefined && input . TargetId !== null && { TargetId : input . TargetId } ) , ... ( input . TargetType !== undefined && input . TargetType !== null && { TargetType : input . TargetType } ) , } ; } ; const serializeAws_json1_1DeleteInlinePolicyFromPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1DeletePermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1DescribeAccountAssignmentCreationStatusRequest = ( input , context ) : any => { return { ... ( input . AccountAssignmentCreationRequestId !== undefined && input . AccountAssignmentCreationRequestId !== null && { AccountAssignmentCreationRequestId : input . AccountAssignmentCreationRequestId , } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1DescribeAccountAssignmentDeletionStatusRequest = ( input , context ) : any => { return { ... ( input . AccountAssignmentDeletionRequestId !== undefined && input . AccountAssignmentDeletionRequestId !== null && { AccountAssignmentDeletionRequestId : input . AccountAssignmentDeletionRequestId , } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1DescribePermissionSetProvisioningStatusRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . ProvisionPermissionSetRequestId !== undefined && input . ProvisionPermissionSetRequestId !== null && { ProvisionPermissionSetRequestId : input . ProvisionPermissionSetRequestId , } ) , } ; } ; const serializeAws_json1_1DescribePermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1DetachManagedPolicyFromPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . ManagedPolicyArn !== undefined && input . ManagedPolicyArn !== null && { ManagedPolicyArn : input . ManagedPolicyArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1GetInlinePolicyForPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1InstanceAccessControlAttributeConfiguration = ( input , context ) : any => { return { ... ( input . AccessControlAttributes !== undefined && input . AccessControlAttributes !== null && { AccessControlAttributes : serializeAws_json1_1AccessControlAttributeList ( input . AccessControlAttributes , context ) , } ) , } ; } ; const serializeAws_json1_1ListAccountAssignmentCreationStatusRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1OperationStatusFilter ( input . Filter , context ) } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListAccountAssignmentDeletionStatusRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1OperationStatusFilter ( input . Filter , context ) } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListAccountAssignmentsRequest = ( input , context ) : any => { return { ... ( input . AccountId !== undefined && input . AccountId !== null && { AccountId : input . AccountId } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1ListAccountsForProvisionedPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , ... ( input . ProvisioningStatus !== undefined && input . ProvisioningStatus !== null && { ProvisioningStatus : input . ProvisioningStatus } ) , } ; } ; const serializeAws_json1_1ListInstancesRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListManagedPoliciesInPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1ListPermissionSetProvisioningStatusRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1OperationStatusFilter ( input . Filter , context ) } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListPermissionSetsProvisionedToAccountRequest = ( input , context ) : any => { return { ... ( input . AccountId !== undefined && input . AccountId !== null && { AccountId : input . AccountId } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ProvisioningStatus !== undefined && input . ProvisioningStatus !== null && { ProvisioningStatus : input . ProvisioningStatus } ) , } ; } ; const serializeAws_json1_1ListPermissionSetsRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_1OperationStatusFilter = ( input , context ) : any => { return { ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , } ; } ; const serializeAws_json1_1ProvisionPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , ... ( input . TargetId !== undefined && input . TargetId !== null && { TargetId : input . TargetId } ) , ... ( input . TargetType !== undefined && input . TargetType !== null && { TargetType : input . TargetType } ) , } ; } ; const serializeAws_json1_1PutInlinePolicyToPermissionSetRequest = ( input , context ) : any => { return { ... ( input . InlinePolicy !== undefined && input . InlinePolicy !== null && { InlinePolicy : input . InlinePolicy } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , } ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TagResourceRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1UntagResourceRequest = ( input , context ) : any => { return { ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_1TagKeyList ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationRequest = ( input , context ) : any => { return { ... ( input . InstanceAccessControlAttributeConfiguration !== undefined && input . InstanceAccessControlAttributeConfiguration !== null && { InstanceAccessControlAttributeConfiguration : serializeAws_json1_1InstanceAccessControlAttributeConfiguration ( input . InstanceAccessControlAttributeConfiguration , context ) , } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , } ; } ; const serializeAws_json1_1UpdatePermissionSetRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . InstanceArn !== undefined && input . InstanceArn !== null && { InstanceArn : input . InstanceArn } ) , ... ( input . PermissionSetArn !== undefined && input . PermissionSetArn !== null && { PermissionSetArn : input . PermissionSetArn } ) , ... ( input . RelayState !== undefined && input . RelayState !== null && { RelayState : input . RelayState } ) , ... ( input . SessionDuration !== undefined && input . SessionDuration !== null && { SessionDuration : input . SessionDuration } ) , } ; } ; const deserializeAws_json1_1AccessControlAttribute = ( output , context ) : AccessControlAttribute => { return { Key : __expectString ( output . Key ) , Value : output . Value !== undefined && output . Value !== null ? deserializeAws_json1_1AccessControlAttributeValue ( output . Value , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AccessControlAttributeList = ( output , context ) : AccessControlAttribute [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AccessControlAttribute ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AccessControlAttributeValue = ( output , context ) : AccessControlAttributeValue => { return { Source : output . Source !== undefined && output . Source !== null ? deserializeAws_json1_1AccessControlAttributeValueSourceList ( output . Source , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AccessControlAttributeValueSourceList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1AccessDeniedException = ( output , context ) : AccessDeniedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1AccountAssignment = ( output , context ) : AccountAssignment => { return { AccountId : __expectString ( output . AccountId ) , PermissionSetArn : __expectString ( output . PermissionSetArn ) , PrincipalId : __expectString ( output . PrincipalId ) , PrincipalType : __expectString ( output . PrincipalType ) , } as any ; } ; const deserializeAws_json1_1AccountAssignmentList = ( output , context ) : AccountAssignment [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AccountAssignment ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AccountAssignmentOperationStatus = ( output , context ) : AccountAssignmentOperationStatus => { return { CreatedDate : output . CreatedDate !== undefined && output . CreatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedDate ) ) ) : undefined , FailureReason : __expectString ( output . FailureReason ) , PermissionSetArn : __expectString ( output . PermissionSetArn ) , PrincipalId : __expectString ( output . PrincipalId ) , PrincipalType : __expectString ( output . PrincipalType ) , RequestId : __expectString ( output . RequestId ) , Status : __expectString ( output . Status ) , TargetId : __expectString ( output . TargetId ) , TargetType : __expectString ( output . TargetType ) , } as any ; } ; const deserializeAws_json1_1AccountAssignmentOperationStatusList = ( output , context ) : AccountAssignmentOperationStatusMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AccountAssignmentOperationStatusMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AccountAssignmentOperationStatusMetadata = ( output , context ) : AccountAssignmentOperationStatusMetadata => { return { CreatedDate : output . CreatedDate !== undefined && output . CreatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedDate ) ) ) : undefined , RequestId : __expectString ( output . RequestId ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1AccountList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1AttachedManagedPolicy = ( output , context ) : AttachedManagedPolicy => { return { Arn : __expectString ( output . Arn ) , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_1AttachedManagedPolicyList = ( output , context ) : AttachedManagedPolicy [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AttachedManagedPolicy ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AttachManagedPolicyToPermissionSetResponse = ( output , context ) : AttachManagedPolicyToPermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1ConflictException = ( output , context ) : ConflictException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1CreateAccountAssignmentResponse = ( output , context ) : CreateAccountAssignmentResponse => { return { AccountAssignmentCreationStatus : output . AccountAssignmentCreationStatus !== undefined && output . AccountAssignmentCreationStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatus ( output . AccountAssignmentCreationStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateInstanceAccessControlAttributeConfigurationResponse = ( output , context ) : CreateInstanceAccessControlAttributeConfigurationResponse => { return { } as any ; } ; const deserializeAws_json1_1CreatePermissionSetResponse = ( output , context ) : CreatePermissionSetResponse => { return { PermissionSet : output . PermissionSet !== undefined && output . PermissionSet !== null ? deserializeAws_json1_1PermissionSet ( output . PermissionSet , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeleteAccountAssignmentResponse = ( output , context ) : DeleteAccountAssignmentResponse => { return { AccountAssignmentDeletionStatus : output . AccountAssignmentDeletionStatus !== undefined && output . AccountAssignmentDeletionStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatus ( output . AccountAssignmentDeletionStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeleteInlinePolicyFromPermissionSetResponse = ( output , context ) : DeleteInlinePolicyFromPermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteInstanceAccessControlAttributeConfigurationResponse = ( output , context ) : DeleteInstanceAccessControlAttributeConfigurationResponse => { return { } as any ; } ; const deserializeAws_json1_1DeletePermissionSetResponse = ( output , context ) : DeletePermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1DescribeAccountAssignmentCreationStatusResponse = ( output , context ) : DescribeAccountAssignmentCreationStatusResponse => { return { AccountAssignmentCreationStatus : output . AccountAssignmentCreationStatus !== undefined && output . AccountAssignmentCreationStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatus ( output . AccountAssignmentCreationStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeAccountAssignmentDeletionStatusResponse = ( output , context ) : DescribeAccountAssignmentDeletionStatusResponse => { return { AccountAssignmentDeletionStatus : output . AccountAssignmentDeletionStatus !== undefined && output . AccountAssignmentDeletionStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatus ( output . AccountAssignmentDeletionStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeInstanceAccessControlAttributeConfigurationResponse = ( output , context ) : DescribeInstanceAccessControlAttributeConfigurationResponse => { return { InstanceAccessControlAttributeConfiguration : output . InstanceAccessControlAttributeConfiguration !== undefined && output . InstanceAccessControlAttributeConfiguration !== null ? deserializeAws_json1_1InstanceAccessControlAttributeConfiguration ( output . InstanceAccessControlAttributeConfiguration , context ) : undefined , Status : __expectString ( output . Status ) , StatusReason : __expectString ( output . StatusReason ) , } as any ; } ; const deserializeAws_json1_1DescribePermissionSetProvisioningStatusResponse = ( output , context ) : DescribePermissionSetProvisioningStatusResponse => { return { PermissionSetProvisioningStatus : output . PermissionSetProvisioningStatus !== undefined && output . PermissionSetProvisioningStatus !== null ? deserializeAws_json1_1PermissionSetProvisioningStatus ( output . PermissionSetProvisioningStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribePermissionSetResponse = ( output , context ) : DescribePermissionSetResponse => { return { PermissionSet : output . PermissionSet !== undefined && output . PermissionSet !== null ? deserializeAws_json1_1PermissionSet ( output . PermissionSet , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DetachManagedPolicyFromPermissionSetResponse = ( output , context ) : DetachManagedPolicyFromPermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1GetInlinePolicyForPermissionSetResponse = ( output , context ) : GetInlinePolicyForPermissionSetResponse => { return { InlinePolicy : __expectString ( output . InlinePolicy ) , } as any ; } ; const deserializeAws_json1_1InstanceAccessControlAttributeConfiguration = ( output , context ) : InstanceAccessControlAttributeConfiguration => { return { AccessControlAttributes : output . AccessControlAttributes !== undefined && output . AccessControlAttributes !== null ? deserializeAws_json1_1AccessControlAttributeList ( output . AccessControlAttributes , context ) : undefined , } as any ; } ; const deserializeAws_json1_1InstanceList = ( output , context ) : InstanceMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1InstanceMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1InstanceMetadata = ( output , context ) : InstanceMetadata => { return { IdentityStoreId : __expectString ( output . IdentityStoreId ) , InstanceArn : __expectString ( output . InstanceArn ) , } as any ; } ; const deserializeAws_json1_1InternalServerException = ( output , context ) : InternalServerException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ListAccountAssignmentCreationStatusResponse = ( output , context ) : ListAccountAssignmentCreationStatusResponse => { return { AccountAssignmentsCreationStatus : output . AccountAssignmentsCreationStatus !== undefined && output . AccountAssignmentsCreationStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatusList ( output . AccountAssignmentsCreationStatus , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListAccountAssignmentDeletionStatusResponse = ( output , context ) : ListAccountAssignmentDeletionStatusResponse => { return { AccountAssignmentsDeletionStatus : output . AccountAssignmentsDeletionStatus !== undefined && output . AccountAssignmentsDeletionStatus !== null ? deserializeAws_json1_1AccountAssignmentOperationStatusList ( output . AccountAssignmentsDeletionStatus , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListAccountAssignmentsResponse = ( output , context ) : ListAccountAssignmentsResponse => { return { AccountAssignments : output . AccountAssignments !== undefined && output . AccountAssignments !== null ? deserializeAws_json1_1AccountAssignmentList ( output . AccountAssignments , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListAccountsForProvisionedPermissionSetResponse = ( output , context ) : ListAccountsForProvisionedPermissionSetResponse => { return { AccountIds : output . AccountIds !== undefined && output . AccountIds !== null ? deserializeAws_json1_1AccountList ( output . AccountIds , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListInstancesResponse = ( output , context ) : ListInstancesResponse => { return { Instances : output . Instances !== undefined && output . Instances !== null ? deserializeAws_json1_1InstanceList ( output . Instances , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListManagedPoliciesInPermissionSetResponse = ( output , context ) : ListManagedPoliciesInPermissionSetResponse => { return { AttachedManagedPolicies : output . AttachedManagedPolicies !== undefined && output . AttachedManagedPolicies !== null ? deserializeAws_json1_1AttachedManagedPolicyList ( output . AttachedManagedPolicies , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListPermissionSetProvisioningStatusResponse = ( output , context ) : ListPermissionSetProvisioningStatusResponse => { return { NextToken : __expectString ( output . NextToken ) , PermissionSetsProvisioningStatus : output . PermissionSetsProvisioningStatus !== undefined && output . PermissionSetsProvisioningStatus !== null ? deserializeAws_json1_1PermissionSetProvisioningStatusList ( output . PermissionSetsProvisioningStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListPermissionSetsProvisionedToAccountResponse = ( output , context ) : ListPermissionSetsProvisionedToAccountResponse => { return { NextToken : __expectString ( output . NextToken ) , PermissionSets : output . PermissionSets !== undefined && output . PermissionSets !== null ? deserializeAws_json1_1PermissionSetList ( output . PermissionSets , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListPermissionSetsResponse = ( output , context ) : ListPermissionSetsResponse => { return { NextToken : __expectString ( output . NextToken ) , PermissionSets : output . PermissionSets !== undefined && output . PermissionSets !== null ? deserializeAws_json1_1PermissionSetList ( output . PermissionSets , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTagsForResourceResponse = ( output , context ) : ListTagsForResourceResponse => { return { NextToken : __expectString ( output . NextToken ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PermissionSet = ( output , context ) : PermissionSet => { return { CreatedDate : output . CreatedDate !== undefined && output . CreatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedDate ) ) ) : undefined , Description : __expectString ( output . Description ) , Name : __expectString ( output . Name ) , PermissionSetArn : __expectString ( output . PermissionSetArn ) , RelayState : __expectString ( output . RelayState ) , SessionDuration : __expectString ( output . SessionDuration ) , } as any ; } ; const deserializeAws_json1_1PermissionSetList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1PermissionSetProvisioningStatus = ( output , context ) : PermissionSetProvisioningStatus => { return { AccountId : __expectString ( output . AccountId ) , CreatedDate : output . CreatedDate !== undefined && output . CreatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedDate ) ) ) : undefined , FailureReason : __expectString ( output . FailureReason ) , PermissionSetArn : __expectString ( output . PermissionSetArn ) , RequestId : __expectString ( output . RequestId ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1PermissionSetProvisioningStatusList = ( output , context ) : PermissionSetProvisioningStatusMetadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PermissionSetProvisioningStatusMetadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PermissionSetProvisioningStatusMetadata = ( output , context ) : PermissionSetProvisioningStatusMetadata => { return { CreatedDate : output . CreatedDate !== undefined && output . CreatedDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedDate ) ) ) : undefined , RequestId : __expectString ( output . RequestId ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1ProvisionPermissionSetResponse = ( output , context ) : ProvisionPermissionSetResponse => { return { PermissionSetProvisioningStatus : output . PermissionSetProvisioningStatus !== undefined && output . PermissionSetProvisioningStatus !== null ? deserializeAws_json1_1PermissionSetProvisioningStatus ( output . PermissionSetProvisioningStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PutInlinePolicyToPermissionSetResponse = ( output , context ) : PutInlinePolicyToPermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ServiceQuotaExceededException = ( output , context ) : ServiceQuotaExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TagResourceResponse = ( output , context ) : TagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1ThrottlingException = ( output , context ) : ThrottlingException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateInstanceAccessControlAttributeConfigurationResponse = ( output , context ) : UpdateInstanceAccessControlAttributeConfigurationResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdatePermissionSetResponse = ( output , context ) : UpdatePermissionSetResponse => { return { } as any ; } ; const deserializeAws_json1_1ValidationException = ( output , context ) : ValidationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;