import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse , isValidHostname as __isValidHostname , } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { CreateActivityCommandInput , CreateActivityCommandOutput } from "../commands/CreateActivityCommand" ; import { CreateStateMachineCommandInput , CreateStateMachineCommandOutput } from "../commands/CreateStateMachineCommand" ; import { DeleteActivityCommandInput , DeleteActivityCommandOutput } from "../commands/DeleteActivityCommand" ; import { DeleteStateMachineCommandInput , DeleteStateMachineCommandOutput } from "../commands/DeleteStateMachineCommand" ; import { DescribeActivityCommandInput , DescribeActivityCommandOutput } from "../commands/DescribeActivityCommand" ; import { DescribeExecutionCommandInput , DescribeExecutionCommandOutput } from "../commands/DescribeExecutionCommand" ; import { DescribeStateMachineCommandInput , DescribeStateMachineCommandOutput , } from "../commands/DescribeStateMachineCommand" ; import { DescribeStateMachineForExecutionCommandInput , DescribeStateMachineForExecutionCommandOutput , } from "../commands/DescribeStateMachineForExecutionCommand" ; import { GetActivityTaskCommandInput , GetActivityTaskCommandOutput } from "../commands/GetActivityTaskCommand" ; import { GetExecutionHistoryCommandInput , GetExecutionHistoryCommandOutput , } from "../commands/GetExecutionHistoryCommand" ; import { ListActivitiesCommandInput , ListActivitiesCommandOutput } from "../commands/ListActivitiesCommand" ; import { ListExecutionsCommandInput , ListExecutionsCommandOutput } from "../commands/ListExecutionsCommand" ; import { ListStateMachinesCommandInput , ListStateMachinesCommandOutput } from "../commands/ListStateMachinesCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { SendTaskFailureCommandInput , SendTaskFailureCommandOutput } from "../commands/SendTaskFailureCommand" ; import { SendTaskHeartbeatCommandInput , SendTaskHeartbeatCommandOutput } from "../commands/SendTaskHeartbeatCommand" ; import { SendTaskSuccessCommandInput , SendTaskSuccessCommandOutput } from "../commands/SendTaskSuccessCommand" ; import { StartExecutionCommandInput , StartExecutionCommandOutput } from "../commands/StartExecutionCommand" ; import { StartSyncExecutionCommandInput , StartSyncExecutionCommandOutput } from "../commands/StartSyncExecutionCommand" ; import { StopExecutionCommandInput , StopExecutionCommandOutput } from "../commands/StopExecutionCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateStateMachineCommandInput , UpdateStateMachineCommandOutput } from "../commands/UpdateStateMachineCommand" ; import { ActivityDoesNotExist , ActivityFailedEventDetails , ActivityLimitExceeded , ActivityListItem , ActivityScheduledEventDetails , ActivityScheduleFailedEventDetails , ActivityStartedEventDetails , ActivitySucceededEventDetails , ActivityTimedOutEventDetails , ActivityWorkerLimitExceeded , BillingDetails , CloudWatchEventsExecutionDataDetails , CloudWatchLogsLogGroup , CreateActivityInput , CreateActivityOutput , CreateStateMachineInput , CreateStateMachineOutput , DeleteActivityInput , DeleteActivityOutput , DeleteStateMachineInput , DeleteStateMachineOutput , DescribeActivityInput , DescribeActivityOutput , DescribeExecutionInput , DescribeExecutionOutput , DescribeStateMachineForExecutionInput , DescribeStateMachineForExecutionOutput , DescribeStateMachineInput , DescribeStateMachineOutput , ExecutionAbortedEventDetails , ExecutionAlreadyExists , ExecutionDoesNotExist , ExecutionFailedEventDetails , ExecutionLimitExceeded , ExecutionListItem , ExecutionStartedEventDetails , ExecutionSucceededEventDetails , ExecutionTimedOutEventDetails , GetActivityTaskInput , GetActivityTaskOutput , GetExecutionHistoryInput , GetExecutionHistoryOutput , HistoryEvent , HistoryEventExecutionDataDetails , InvalidArn , InvalidDefinition , InvalidExecutionInput , InvalidLoggingConfiguration , InvalidName , InvalidOutput , InvalidToken , InvalidTracingConfiguration , LambdaFunctionFailedEventDetails , LambdaFunctionScheduledEventDetails , LambdaFunctionScheduleFailedEventDetails , LambdaFunctionStartFailedEventDetails , LambdaFunctionSucceededEventDetails , LambdaFunctionTimedOutEventDetails , ListActivitiesInput , ListActivitiesOutput , ListExecutionsInput , ListExecutionsOutput , ListStateMachinesInput , ListStateMachinesOutput , ListTagsForResourceInput , ListTagsForResourceOutput , LogDestination , LoggingConfiguration , MapIterationEventDetails , MapStateStartedEventDetails , MissingRequiredParameter , ResourceNotFound , SendTaskFailureInput , SendTaskFailureOutput , SendTaskHeartbeatInput , SendTaskHeartbeatOutput , SendTaskSuccessInput , SendTaskSuccessOutput , StartExecutionInput , StartExecutionOutput , StartSyncExecutionInput , StartSyncExecutionOutput , StateEnteredEventDetails , StateExitedEventDetails , StateMachineAlreadyExists , StateMachineDeleting , StateMachineDoesNotExist , StateMachineLimitExceeded , StateMachineListItem , StateMachineTypeNotSupported , StopExecutionInput , StopExecutionOutput , Tag , TagResourceInput , TagResourceOutput , TaskDoesNotExist , TaskFailedEventDetails , TaskScheduledEventDetails , TaskStartedEventDetails , TaskStartFailedEventDetails , TaskSubmitFailedEventDetails , TaskSubmittedEventDetails , TaskSucceededEventDetails , TaskTimedOut , TaskTimedOutEventDetails , TooManyTags , TracingConfiguration , UntagResourceInput , UntagResourceOutput , UpdateStateMachineInput , UpdateStateMachineOutput , } from "../models/models_0" ; export const serializeAws_json1_0CreateActivityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.CreateActivity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateActivityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateStateMachineCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.CreateStateMachine" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateStateMachineInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteActivityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DeleteActivity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteActivityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteStateMachineCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DeleteStateMachine" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteStateMachineInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeActivityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DescribeActivity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeActivityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeExecutionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DescribeExecution" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeExecutionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeStateMachineCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DescribeStateMachine" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeStateMachineInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DescribeStateMachineForExecutionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.DescribeStateMachineForExecution" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DescribeStateMachineForExecutionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetActivityTaskCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.GetActivityTask" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetActivityTaskInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetExecutionHistoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.GetExecutionHistory" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetExecutionHistoryInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListActivitiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.ListActivities" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListActivitiesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListExecutionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.ListExecutions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListExecutionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListStateMachinesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.ListStateMachines" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListStateMachinesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListTagsForResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0SendTaskFailureCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.SendTaskFailure" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0SendTaskFailureInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0SendTaskHeartbeatCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.SendTaskHeartbeat" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0SendTaskHeartbeatInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0SendTaskSuccessCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.SendTaskSuccess" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0SendTaskSuccessInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0StartExecutionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.StartExecution" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0StartExecutionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0StartSyncExecutionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.StartSyncExecution" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0StartSyncExecutionInput ( input , context ) ) ; let { hostname : resolvedHostname } = await context . endpoint ( ) ; if ( context . disableHostPrefix !== true ) { resolvedHostname = "sync-" + resolvedHostname ; if ( ! __isValidHostname ( resolvedHostname ) ) { throw new Error ( "ValidationError: prefixed hostname must be hostname compatible." ) ; } } return buildHttpRpcRequest ( context , headers , "/" , resolvedHostname , body ) ; } ; export const serializeAws_json1_0StopExecutionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.StopExecution" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0StopExecutionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0TagResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UntagResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateStateMachineCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AWSStepFunctions.UpdateStateMachine" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateStateMachineInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_0CreateActivityCommand = async ( output , context ) : Promise < CreateActivityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateActivityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateActivityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateActivityCommandError = async ( output , context ) : Promise < CreateActivityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ActivityLimitExceeded" : case "com.amazonaws.sfn#ActivityLimitExceeded" : response = { ... ( await deserializeAws_json1_0ActivityLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidName" : case "com.amazonaws.sfn#InvalidName" : response = { ... ( await deserializeAws_json1_0InvalidNameResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTags" : case "com.amazonaws.sfn#TooManyTags" : response = { ... ( await deserializeAws_json1_0TooManyTagsResponse ( 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_0CreateStateMachineCommand = async ( output , context ) : Promise < CreateStateMachineCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateStateMachineCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateStateMachineOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateStateMachineCommandError = async ( output , context ) : Promise < CreateStateMachineCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidDefinition" : case "com.amazonaws.sfn#InvalidDefinition" : response = { ... ( await deserializeAws_json1_0InvalidDefinitionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLoggingConfiguration" : case "com.amazonaws.sfn#InvalidLoggingConfiguration" : response = { ... ( await deserializeAws_json1_0InvalidLoggingConfigurationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidName" : case "com.amazonaws.sfn#InvalidName" : response = { ... ( await deserializeAws_json1_0InvalidNameResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTracingConfiguration" : case "com.amazonaws.sfn#InvalidTracingConfiguration" : response = { ... ( await deserializeAws_json1_0InvalidTracingConfigurationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineAlreadyExists" : case "com.amazonaws.sfn#StateMachineAlreadyExists" : response = { ... ( await deserializeAws_json1_0StateMachineAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDeleting" : case "com.amazonaws.sfn#StateMachineDeleting" : response = { ... ( await deserializeAws_json1_0StateMachineDeletingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineLimitExceeded" : case "com.amazonaws.sfn#StateMachineLimitExceeded" : response = { ... ( await deserializeAws_json1_0StateMachineLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineTypeNotSupported" : case "com.amazonaws.sfn#StateMachineTypeNotSupported" : response = { ... ( await deserializeAws_json1_0StateMachineTypeNotSupportedResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTags" : case "com.amazonaws.sfn#TooManyTags" : response = { ... ( await deserializeAws_json1_0TooManyTagsResponse ( 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_0DeleteActivityCommand = async ( output , context ) : Promise < DeleteActivityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteActivityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteActivityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteActivityCommandError = async ( output , context ) : Promise < DeleteActivityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0DeleteStateMachineCommand = async ( output , context ) : Promise < DeleteStateMachineCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteStateMachineCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteStateMachineOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteStateMachineCommandError = async ( output , context ) : Promise < DeleteStateMachineCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0DescribeActivityCommand = async ( output , context ) : Promise < DescribeActivityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeActivityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeActivityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeActivityCommandError = async ( output , context ) : Promise < DescribeActivityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ActivityDoesNotExist" : case "com.amazonaws.sfn#ActivityDoesNotExist" : response = { ... ( await deserializeAws_json1_0ActivityDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0DescribeExecutionCommand = async ( output , context ) : Promise < DescribeExecutionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeExecutionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeExecutionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeExecutionCommandError = async ( output , context ) : Promise < DescribeExecutionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ExecutionDoesNotExist" : case "com.amazonaws.sfn#ExecutionDoesNotExist" : response = { ... ( await deserializeAws_json1_0ExecutionDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0DescribeStateMachineCommand = async ( output , context ) : Promise < DescribeStateMachineCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeStateMachineCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeStateMachineOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeStateMachineCommandError = async ( output , context ) : Promise < DescribeStateMachineCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDoesNotExist" : case "com.amazonaws.sfn#StateMachineDoesNotExist" : response = { ... ( await deserializeAws_json1_0StateMachineDoesNotExistResponse ( 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_0DescribeStateMachineForExecutionCommand = async ( output , context ) : Promise < DescribeStateMachineForExecutionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DescribeStateMachineForExecutionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DescribeStateMachineForExecutionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DescribeStateMachineForExecutionCommandError = async ( output , context ) : Promise < DescribeStateMachineForExecutionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ExecutionDoesNotExist" : case "com.amazonaws.sfn#ExecutionDoesNotExist" : response = { ... ( await deserializeAws_json1_0ExecutionDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0GetActivityTaskCommand = async ( output , context ) : Promise < GetActivityTaskCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetActivityTaskCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetActivityTaskOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetActivityTaskCommandError = async ( output , context ) : Promise < GetActivityTaskCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ActivityDoesNotExist" : case "com.amazonaws.sfn#ActivityDoesNotExist" : response = { ... ( await deserializeAws_json1_0ActivityDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ActivityWorkerLimitExceeded" : case "com.amazonaws.sfn#ActivityWorkerLimitExceeded" : response = { ... ( await deserializeAws_json1_0ActivityWorkerLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0GetExecutionHistoryCommand = async ( output , context ) : Promise < GetExecutionHistoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetExecutionHistoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetExecutionHistoryOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetExecutionHistoryCommandError = async ( output , context ) : Promise < GetExecutionHistoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ExecutionDoesNotExist" : case "com.amazonaws.sfn#ExecutionDoesNotExist" : response = { ... ( await deserializeAws_json1_0ExecutionDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( 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_0ListActivitiesCommand = async ( output , context ) : Promise < ListActivitiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListActivitiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListActivitiesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListActivitiesCommandError = async ( output , context ) : Promise < ListActivitiesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( 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_0ListExecutionsCommand = async ( output , context ) : Promise < ListExecutionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListExecutionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListExecutionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListExecutionsCommandError = async ( output , context ) : Promise < ListExecutionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDoesNotExist" : case "com.amazonaws.sfn#StateMachineDoesNotExist" : response = { ... ( await deserializeAws_json1_0StateMachineDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineTypeNotSupported" : case "com.amazonaws.sfn#StateMachineTypeNotSupported" : response = { ... ( await deserializeAws_json1_0StateMachineTypeNotSupportedResponse ( 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_0ListStateMachinesCommand = async ( output , context ) : Promise < ListStateMachinesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListStateMachinesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListStateMachinesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListStateMachinesCommandError = async ( output , context ) : Promise < ListStateMachinesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( 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_0ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListTagsForResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListTagsForResourceCommandError = 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 "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFound" : case "com.amazonaws.sfn#ResourceNotFound" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundResponse ( 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_0SendTaskFailureCommand = async ( output , context ) : Promise < SendTaskFailureCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0SendTaskFailureCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0SendTaskFailureOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0SendTaskFailureCommandError = async ( output , context ) : Promise < SendTaskFailureCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskDoesNotExist" : case "com.amazonaws.sfn#TaskDoesNotExist" : response = { ... ( await deserializeAws_json1_0TaskDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskTimedOut" : case "com.amazonaws.sfn#TaskTimedOut" : response = { ... ( await deserializeAws_json1_0TaskTimedOutResponse ( 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_0SendTaskHeartbeatCommand = async ( output , context ) : Promise < SendTaskHeartbeatCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0SendTaskHeartbeatCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0SendTaskHeartbeatOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0SendTaskHeartbeatCommandError = async ( output , context ) : Promise < SendTaskHeartbeatCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskDoesNotExist" : case "com.amazonaws.sfn#TaskDoesNotExist" : response = { ... ( await deserializeAws_json1_0TaskDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskTimedOut" : case "com.amazonaws.sfn#TaskTimedOut" : response = { ... ( await deserializeAws_json1_0TaskTimedOutResponse ( 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_0SendTaskSuccessCommand = async ( output , context ) : Promise < SendTaskSuccessCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0SendTaskSuccessCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0SendTaskSuccessOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0SendTaskSuccessCommandError = async ( output , context ) : Promise < SendTaskSuccessCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidOutput" : case "com.amazonaws.sfn#InvalidOutput" : response = { ... ( await deserializeAws_json1_0InvalidOutputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidToken" : case "com.amazonaws.sfn#InvalidToken" : response = { ... ( await deserializeAws_json1_0InvalidTokenResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskDoesNotExist" : case "com.amazonaws.sfn#TaskDoesNotExist" : response = { ... ( await deserializeAws_json1_0TaskDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaskTimedOut" : case "com.amazonaws.sfn#TaskTimedOut" : response = { ... ( await deserializeAws_json1_0TaskTimedOutResponse ( 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_0StartExecutionCommand = async ( output , context ) : Promise < StartExecutionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0StartExecutionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0StartExecutionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0StartExecutionCommandError = async ( output , context ) : Promise < StartExecutionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ExecutionAlreadyExists" : case "com.amazonaws.sfn#ExecutionAlreadyExists" : response = { ... ( await deserializeAws_json1_0ExecutionAlreadyExistsResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ExecutionLimitExceeded" : case "com.amazonaws.sfn#ExecutionLimitExceeded" : response = { ... ( await deserializeAws_json1_0ExecutionLimitExceededResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidExecutionInput" : case "com.amazonaws.sfn#InvalidExecutionInput" : response = { ... ( await deserializeAws_json1_0InvalidExecutionInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidName" : case "com.amazonaws.sfn#InvalidName" : response = { ... ( await deserializeAws_json1_0InvalidNameResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDeleting" : case "com.amazonaws.sfn#StateMachineDeleting" : response = { ... ( await deserializeAws_json1_0StateMachineDeletingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDoesNotExist" : case "com.amazonaws.sfn#StateMachineDoesNotExist" : response = { ... ( await deserializeAws_json1_0StateMachineDoesNotExistResponse ( 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_0StartSyncExecutionCommand = async ( output , context ) : Promise < StartSyncExecutionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0StartSyncExecutionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0StartSyncExecutionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0StartSyncExecutionCommandError = async ( output , context ) : Promise < StartSyncExecutionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidExecutionInput" : case "com.amazonaws.sfn#InvalidExecutionInput" : response = { ... ( await deserializeAws_json1_0InvalidExecutionInputResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidName" : case "com.amazonaws.sfn#InvalidName" : response = { ... ( await deserializeAws_json1_0InvalidNameResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDeleting" : case "com.amazonaws.sfn#StateMachineDeleting" : response = { ... ( await deserializeAws_json1_0StateMachineDeletingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDoesNotExist" : case "com.amazonaws.sfn#StateMachineDoesNotExist" : response = { ... ( await deserializeAws_json1_0StateMachineDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineTypeNotSupported" : case "com.amazonaws.sfn#StateMachineTypeNotSupported" : response = { ... ( await deserializeAws_json1_0StateMachineTypeNotSupportedResponse ( 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_0StopExecutionCommand = async ( output , context ) : Promise < StopExecutionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0StopExecutionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0StopExecutionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0StopExecutionCommandError = async ( output , context ) : Promise < StopExecutionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ExecutionDoesNotExist" : case "com.amazonaws.sfn#ExecutionDoesNotExist" : response = { ... ( await deserializeAws_json1_0ExecutionDoesNotExistResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( 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_0TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0TagResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0TagResourceCommandError = 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 "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFound" : case "com.amazonaws.sfn#ResourceNotFound" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTags" : case "com.amazonaws.sfn#TooManyTags" : response = { ... ( await deserializeAws_json1_0TooManyTagsResponse ( 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_0UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UntagResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UntagResourceCommandError = 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 "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFound" : case "com.amazonaws.sfn#ResourceNotFound" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundResponse ( 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_0UpdateStateMachineCommand = async ( output , context ) : Promise < UpdateStateMachineCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateStateMachineCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateStateMachineOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateStateMachineCommandError = async ( output , context ) : Promise < UpdateStateMachineCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidArn" : case "com.amazonaws.sfn#InvalidArn" : response = { ... ( await deserializeAws_json1_0InvalidArnResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidDefinition" : case "com.amazonaws.sfn#InvalidDefinition" : response = { ... ( await deserializeAws_json1_0InvalidDefinitionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLoggingConfiguration" : case "com.amazonaws.sfn#InvalidLoggingConfiguration" : response = { ... ( await deserializeAws_json1_0InvalidLoggingConfigurationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTracingConfiguration" : case "com.amazonaws.sfn#InvalidTracingConfiguration" : response = { ... ( await deserializeAws_json1_0InvalidTracingConfigurationResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "MissingRequiredParameter" : case "com.amazonaws.sfn#MissingRequiredParameter" : response = { ... ( await deserializeAws_json1_0MissingRequiredParameterResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDeleting" : case "com.amazonaws.sfn#StateMachineDeleting" : response = { ... ( await deserializeAws_json1_0StateMachineDeletingResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "StateMachineDoesNotExist" : case "com.amazonaws.sfn#StateMachineDoesNotExist" : response = { ... ( await deserializeAws_json1_0StateMachineDoesNotExistResponse ( 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_0ActivityDoesNotExistResponse = async ( parsedOutput , context ) : Promise < ActivityDoesNotExist > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ActivityDoesNotExist ( body , context ) ; const contents = { name : "ActivityDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ActivityLimitExceededResponse = async ( parsedOutput , context ) : Promise < ActivityLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ActivityLimitExceeded ( body , context ) ; const contents = { name : "ActivityLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ActivityWorkerLimitExceededResponse = async ( parsedOutput , context ) : Promise < ActivityWorkerLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ActivityWorkerLimitExceeded ( body , context ) ; const contents = { name : "ActivityWorkerLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ExecutionAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < ExecutionAlreadyExists > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ExecutionAlreadyExists ( body , context ) ; const contents = { name : "ExecutionAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ExecutionDoesNotExistResponse = async ( parsedOutput , context ) : Promise < ExecutionDoesNotExist > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ExecutionDoesNotExist ( body , context ) ; const contents = { name : "ExecutionDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ExecutionLimitExceededResponse = async ( parsedOutput , context ) : Promise < ExecutionLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ExecutionLimitExceeded ( body , context ) ; const contents = { name : "ExecutionLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidArnResponse = async ( parsedOutput , context ) : Promise < InvalidArn > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidArn ( body , context ) ; const contents = { name : "InvalidArn" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidDefinitionResponse = async ( parsedOutput , context ) : Promise < InvalidDefinition > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidDefinition ( body , context ) ; const contents = { name : "InvalidDefinition" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidExecutionInputResponse = async ( parsedOutput , context ) : Promise < InvalidExecutionInput > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidExecutionInput ( body , context ) ; const contents = { name : "InvalidExecutionInput" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidLoggingConfigurationResponse = async ( parsedOutput , context ) : Promise < InvalidLoggingConfiguration > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidLoggingConfiguration ( body , context ) ; const contents = { name : "InvalidLoggingConfiguration" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidNameResponse = async ( parsedOutput , context ) : Promise < InvalidName > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidName ( body , context ) ; const contents = { name : "InvalidName" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidOutputResponse = async ( parsedOutput , context ) : Promise < InvalidOutput > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidOutput ( body , context ) ; const contents = { name : "InvalidOutput" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidTokenResponse = async ( parsedOutput , context ) : Promise < InvalidToken > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidToken ( body , context ) ; const contents = { name : "InvalidToken" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InvalidTracingConfigurationResponse = async ( parsedOutput , context ) : Promise < InvalidTracingConfiguration > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InvalidTracingConfiguration ( body , context ) ; const contents = { name : "InvalidTracingConfiguration" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0MissingRequiredParameterResponse = async ( parsedOutput , context ) : Promise < MissingRequiredParameter > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0MissingRequiredParameter ( body , context ) ; const contents = { name : "MissingRequiredParameter" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ResourceNotFoundResponse = async ( parsedOutput , context ) : Promise < ResourceNotFound > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ResourceNotFound ( body , context ) ; const contents = { name : "ResourceNotFound" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0StateMachineAlreadyExistsResponse = async ( parsedOutput , context ) : Promise < StateMachineAlreadyExists > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0StateMachineAlreadyExists ( body , context ) ; const contents = { name : "StateMachineAlreadyExists" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0StateMachineDeletingResponse = async ( parsedOutput , context ) : Promise < StateMachineDeleting > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0StateMachineDeleting ( body , context ) ; const contents = { name : "StateMachineDeleting" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0StateMachineDoesNotExistResponse = async ( parsedOutput , context ) : Promise < StateMachineDoesNotExist > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0StateMachineDoesNotExist ( body , context ) ; const contents = { name : "StateMachineDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0StateMachineLimitExceededResponse = async ( parsedOutput , context ) : Promise < StateMachineLimitExceeded > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0StateMachineLimitExceeded ( body , context ) ; const contents = { name : "StateMachineLimitExceeded" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0StateMachineTypeNotSupportedResponse = async ( parsedOutput , context ) : Promise < StateMachineTypeNotSupported > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0StateMachineTypeNotSupported ( body , context ) ; const contents = { name : "StateMachineTypeNotSupported" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0TaskDoesNotExistResponse = async ( parsedOutput , context ) : Promise < TaskDoesNotExist > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0TaskDoesNotExist ( body , context ) ; const contents = { name : "TaskDoesNotExist" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0TaskTimedOutResponse = async ( parsedOutput , context ) : Promise < TaskTimedOut > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0TaskTimedOut ( body , context ) ; const contents = { name : "TaskTimedOut" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0TooManyTagsResponse = async ( parsedOutput , context ) : Promise < TooManyTags > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0TooManyTags ( body , context ) ; const contents = { name : "TooManyTags" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_0CloudWatchLogsLogGroup = ( input , context ) : any => { return { ... ( input . logGroupArn !== undefined && input . logGroupArn !== null && { logGroupArn : input . logGroupArn } ) , } ; } ; const serializeAws_json1_0CreateActivityInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0CreateStateMachineInput = ( input , context ) : any => { return { ... ( input . definition !== undefined && input . definition !== null && { definition : input . definition } ) , ... ( input . loggingConfiguration !== undefined && input . loggingConfiguration !== null && { loggingConfiguration : serializeAws_json1_0LoggingConfiguration ( input . loggingConfiguration , context ) , } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . roleArn !== undefined && input . roleArn !== null && { roleArn : input . roleArn } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , ... ( input . tracingConfiguration !== undefined && input . tracingConfiguration !== null && { tracingConfiguration : serializeAws_json1_0TracingConfiguration ( input . tracingConfiguration , context ) , } ) , ... ( input . type !== undefined && input . type !== null && { type : input . type } ) , } ; } ; const serializeAws_json1_0DeleteActivityInput = ( input , context ) : any => { return { ... ( input . activityArn !== undefined && input . activityArn !== null && { activityArn : input . activityArn } ) , } ; } ; const serializeAws_json1_0DeleteStateMachineInput = ( input , context ) : any => { return { ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , } ; } ; const serializeAws_json1_0DescribeActivityInput = ( input , context ) : any => { return { ... ( input . activityArn !== undefined && input . activityArn !== null && { activityArn : input . activityArn } ) , } ; } ; const serializeAws_json1_0DescribeExecutionInput = ( input , context ) : any => { return { ... ( input . executionArn !== undefined && input . executionArn !== null && { executionArn : input . executionArn } ) , } ; } ; const serializeAws_json1_0DescribeStateMachineForExecutionInput = ( input , context ) : any => { return { ... ( input . executionArn !== undefined && input . executionArn !== null && { executionArn : input . executionArn } ) , } ; } ; const serializeAws_json1_0DescribeStateMachineInput = ( input , context ) : any => { return { ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , } ; } ; const serializeAws_json1_0GetActivityTaskInput = ( input , context ) : any => { return { ... ( input . activityArn !== undefined && input . activityArn !== null && { activityArn : input . activityArn } ) , ... ( input . workerName !== undefined && input . workerName !== null && { workerName : input . workerName } ) , } ; } ; const serializeAws_json1_0GetExecutionHistoryInput = ( input , context ) : any => { return { ... ( input . executionArn !== undefined && input . executionArn !== null && { executionArn : input . executionArn } ) , ... ( input . includeExecutionData !== undefined && input . includeExecutionData !== null && { includeExecutionData : input . includeExecutionData } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . reverseOrder !== undefined && input . reverseOrder !== null && { reverseOrder : input . reverseOrder } ) , } ; } ; const serializeAws_json1_0ListActivitiesInput = ( 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_0ListExecutionsInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , ... ( input . statusFilter !== undefined && input . statusFilter !== null && { statusFilter : input . statusFilter } ) , } ; } ; const serializeAws_json1_0ListStateMachinesInput = ( 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_0ListTagsForResourceInput = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , } ; } ; const serializeAws_json1_0LogDestination = ( input , context ) : any => { return { ... ( input . cloudWatchLogsLogGroup !== undefined && input . cloudWatchLogsLogGroup !== null && { cloudWatchLogsLogGroup : serializeAws_json1_0CloudWatchLogsLogGroup ( input . cloudWatchLogsLogGroup , context ) , } ) , } ; } ; const serializeAws_json1_0LogDestinationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0LogDestination ( entry , context ) ; } ) ; } ; const serializeAws_json1_0LoggingConfiguration = ( input , context ) : any => { return { ... ( input . destinations !== undefined && input . destinations !== null && { destinations : serializeAws_json1_0LogDestinationList ( input . destinations , context ) , } ) , ... ( input . includeExecutionData !== undefined && input . includeExecutionData !== null && { includeExecutionData : input . includeExecutionData } ) , ... ( input . level !== undefined && input . level !== null && { level : input . level } ) , } ; } ; const serializeAws_json1_0SendTaskFailureInput = ( input , context ) : any => { return { ... ( input . cause !== undefined && input . cause !== null && { cause : input . cause } ) , ... ( input . error !== undefined && input . error !== null && { error : input . error } ) , ... ( input . taskToken !== undefined && input . taskToken !== null && { taskToken : input . taskToken } ) , } ; } ; const serializeAws_json1_0SendTaskHeartbeatInput = ( input , context ) : any => { return { ... ( input . taskToken !== undefined && input . taskToken !== null && { taskToken : input . taskToken } ) , } ; } ; const serializeAws_json1_0SendTaskSuccessInput = ( input , context ) : any => { return { ... ( input . output !== undefined && input . output !== null && { output : input . output } ) , ... ( input . taskToken !== undefined && input . taskToken !== null && { taskToken : input . taskToken } ) , } ; } ; const serializeAws_json1_0StartExecutionInput = ( input , context ) : any => { return { ... ( input . input !== undefined && input . input !== null && { input : input . input } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , ... ( input . traceHeader !== undefined && input . traceHeader !== null && { traceHeader : input . traceHeader } ) , } ; } ; const serializeAws_json1_0StartSyncExecutionInput = ( input , context ) : any => { return { ... ( input . input !== undefined && input . input !== null && { input : input . input } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , ... ( input . traceHeader !== undefined && input . traceHeader !== null && { traceHeader : input . traceHeader } ) , } ; } ; const serializeAws_json1_0StopExecutionInput = ( input , context ) : any => { return { ... ( input . cause !== undefined && input . cause !== null && { cause : input . cause } ) , ... ( input . error !== undefined && input . error !== null && { error : input . error } ) , ... ( input . executionArn !== undefined && input . executionArn !== null && { executionArn : input . executionArn } ) , } ; } ; const serializeAws_json1_0Tag = ( 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_0TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_0TagResourceInput = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0TracingConfiguration = ( input , context ) : any => { return { ... ( input . enabled !== undefined && input . enabled !== null && { enabled : input . enabled } ) , } ; } ; const serializeAws_json1_0UntagResourceInput = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , ... ( input . tagKeys !== undefined && input . tagKeys !== null && { tagKeys : serializeAws_json1_0TagKeyList ( input . tagKeys , context ) } ) , } ; } ; const serializeAws_json1_0UpdateStateMachineInput = ( input , context ) : any => { return { ... ( input . definition !== undefined && input . definition !== null && { definition : input . definition } ) , ... ( input . loggingConfiguration !== undefined && input . loggingConfiguration !== null && { loggingConfiguration : serializeAws_json1_0LoggingConfiguration ( input . loggingConfiguration , context ) , } ) , ... ( input . roleArn !== undefined && input . roleArn !== null && { roleArn : input . roleArn } ) , ... ( input . stateMachineArn !== undefined && input . stateMachineArn !== null && { stateMachineArn : input . stateMachineArn } ) , ... ( input . tracingConfiguration !== undefined && input . tracingConfiguration !== null && { tracingConfiguration : serializeAws_json1_0TracingConfiguration ( input . tracingConfiguration , context ) , } ) , } ; } ; const deserializeAws_json1_0ActivityDoesNotExist = ( output , context ) : ActivityDoesNotExist => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ActivityFailedEventDetails = ( output , context ) : ActivityFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ActivityLimitExceeded = ( output , context ) : ActivityLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ActivityList = ( output , context ) : ActivityListItem [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ActivityListItem ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ActivityListItem = ( output , context ) : ActivityListItem => { return { activityArn : __expectString ( output . activityArn ) , creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_0ActivityScheduledEventDetails = ( output , context ) : ActivityScheduledEventDetails => { return { heartbeatInSeconds : __expectLong ( output . heartbeatInSeconds ) , input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . inputDetails , context ) : undefined , resource : __expectString ( output . resource ) , timeoutInSeconds : __expectLong ( output . timeoutInSeconds ) , } as any ; } ; const deserializeAws_json1_0ActivityScheduleFailedEventDetails = ( output , context ) : ActivityScheduleFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ActivityStartedEventDetails = ( output , context ) : ActivityStartedEventDetails => { return { workerName : __expectString ( output . workerName ) , } as any ; } ; const deserializeAws_json1_0ActivitySucceededEventDetails = ( output , context ) : ActivitySucceededEventDetails => { return { output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ActivityTimedOutEventDetails = ( output , context ) : ActivityTimedOutEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ActivityWorkerLimitExceeded = ( output , context ) : ActivityWorkerLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0BillingDetails = ( output , context ) : BillingDetails => { return { billedDurationInMilliseconds : __expectLong ( output . billedDurationInMilliseconds ) , billedMemoryUsedInMB : __expectLong ( output . billedMemoryUsedInMB ) , } as any ; } ; const deserializeAws_json1_0CloudWatchEventsExecutionDataDetails = ( output , context ) : CloudWatchEventsExecutionDataDetails => { return { included : __expectBoolean ( output . included ) , } as any ; } ; const deserializeAws_json1_0CloudWatchLogsLogGroup = ( output , context ) : CloudWatchLogsLogGroup => { return { logGroupArn : __expectString ( output . logGroupArn ) , } as any ; } ; const deserializeAws_json1_0CreateActivityOutput = ( output , context ) : CreateActivityOutput => { return { activityArn : __expectString ( output . activityArn ) , creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateStateMachineOutput = ( output , context ) : CreateStateMachineOutput => { return { creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , stateMachineArn : __expectString ( output . stateMachineArn ) , } as any ; } ; const deserializeAws_json1_0DeleteActivityOutput = ( output , context ) : DeleteActivityOutput => { return { } as any ; } ; const deserializeAws_json1_0DeleteStateMachineOutput = ( output , context ) : DeleteStateMachineOutput => { return { } as any ; } ; const deserializeAws_json1_0DescribeActivityOutput = ( output , context ) : DescribeActivityOutput => { return { activityArn : __expectString ( output . activityArn ) , creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_0DescribeExecutionOutput = ( output , context ) : DescribeExecutionOutput => { return { executionArn : __expectString ( output . executionArn ) , input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0CloudWatchEventsExecutionDataDetails ( output . inputDetails , context ) : undefined , name : __expectString ( output . name ) , output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0CloudWatchEventsExecutionDataDetails ( output . outputDetails , context ) : undefined , startDate : output . startDate !== undefined && output . startDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startDate ) ) ) : undefined , stateMachineArn : __expectString ( output . stateMachineArn ) , status : __expectString ( output . status ) , stopDate : output . stopDate !== undefined && output . stopDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopDate ) ) ) : undefined , traceHeader : __expectString ( output . traceHeader ) , } as any ; } ; const deserializeAws_json1_0DescribeStateMachineForExecutionOutput = ( output , context ) : DescribeStateMachineForExecutionOutput => { return { definition : __expectString ( output . definition ) , loggingConfiguration : output . loggingConfiguration !== undefined && output . loggingConfiguration !== null ? deserializeAws_json1_0LoggingConfiguration ( output . loggingConfiguration , context ) : undefined , name : __expectString ( output . name ) , roleArn : __expectString ( output . roleArn ) , stateMachineArn : __expectString ( output . stateMachineArn ) , tracingConfiguration : output . tracingConfiguration !== undefined && output . tracingConfiguration !== null ? deserializeAws_json1_0TracingConfiguration ( output . tracingConfiguration , context ) : undefined , updateDate : output . updateDate !== undefined && output . updateDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . updateDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_0DescribeStateMachineOutput = ( output , context ) : DescribeStateMachineOutput => { return { creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , definition : __expectString ( output . definition ) , loggingConfiguration : output . loggingConfiguration !== undefined && output . loggingConfiguration !== null ? deserializeAws_json1_0LoggingConfiguration ( output . loggingConfiguration , context ) : undefined , name : __expectString ( output . name ) , roleArn : __expectString ( output . roleArn ) , stateMachineArn : __expectString ( output . stateMachineArn ) , status : __expectString ( output . status ) , tracingConfiguration : output . tracingConfiguration !== undefined && output . tracingConfiguration !== null ? deserializeAws_json1_0TracingConfiguration ( output . tracingConfiguration , context ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_0ExecutionAbortedEventDetails = ( output , context ) : ExecutionAbortedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ExecutionAlreadyExists = ( output , context ) : ExecutionAlreadyExists => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ExecutionDoesNotExist = ( output , context ) : ExecutionDoesNotExist => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ExecutionFailedEventDetails = ( output , context ) : ExecutionFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ExecutionLimitExceeded = ( output , context ) : ExecutionLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ExecutionList = ( output , context ) : ExecutionListItem [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ExecutionListItem ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ExecutionListItem = ( output , context ) : ExecutionListItem => { return { executionArn : __expectString ( output . executionArn ) , name : __expectString ( output . name ) , startDate : output . startDate !== undefined && output . startDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startDate ) ) ) : undefined , stateMachineArn : __expectString ( output . stateMachineArn ) , status : __expectString ( output . status ) , stopDate : output . stopDate !== undefined && output . stopDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_0ExecutionStartedEventDetails = ( output , context ) : ExecutionStartedEventDetails => { return { input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . inputDetails , context ) : undefined , roleArn : __expectString ( output . roleArn ) , } as any ; } ; const deserializeAws_json1_0ExecutionSucceededEventDetails = ( output , context ) : ExecutionSucceededEventDetails => { return { output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ExecutionTimedOutEventDetails = ( output , context ) : ExecutionTimedOutEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0GetActivityTaskOutput = ( output , context ) : GetActivityTaskOutput => { return { input : __expectString ( output . input ) , taskToken : __expectString ( output . taskToken ) , } as any ; } ; const deserializeAws_json1_0GetExecutionHistoryOutput = ( output , context ) : GetExecutionHistoryOutput => { return { events : output . events !== undefined && output . events !== null ? deserializeAws_json1_0HistoryEventList ( output . events , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_0HistoryEvent = ( output , context ) : HistoryEvent => { return { activityFailedEventDetails : output . activityFailedEventDetails !== undefined && output . activityFailedEventDetails !== null ? deserializeAws_json1_0ActivityFailedEventDetails ( output . activityFailedEventDetails , context ) : undefined , activityScheduleFailedEventDetails : output . activityScheduleFailedEventDetails !== undefined && output . activityScheduleFailedEventDetails !== null ? deserializeAws_json1_0ActivityScheduleFailedEventDetails ( output . activityScheduleFailedEventDetails , context ) : undefined , activityScheduledEventDetails : output . activityScheduledEventDetails !== undefined && output . activityScheduledEventDetails !== null ? deserializeAws_json1_0ActivityScheduledEventDetails ( output . activityScheduledEventDetails , context ) : undefined , activityStartedEventDetails : output . activityStartedEventDetails !== undefined && output . activityStartedEventDetails !== null ? deserializeAws_json1_0ActivityStartedEventDetails ( output . activityStartedEventDetails , context ) : undefined , activitySucceededEventDetails : output . activitySucceededEventDetails !== undefined && output . activitySucceededEventDetails !== null ? deserializeAws_json1_0ActivitySucceededEventDetails ( output . activitySucceededEventDetails , context ) : undefined , activityTimedOutEventDetails : output . activityTimedOutEventDetails !== undefined && output . activityTimedOutEventDetails !== null ? deserializeAws_json1_0ActivityTimedOutEventDetails ( output . activityTimedOutEventDetails , context ) : undefined , executionAbortedEventDetails : output . executionAbortedEventDetails !== undefined && output . executionAbortedEventDetails !== null ? deserializeAws_json1_0ExecutionAbortedEventDetails ( output . executionAbortedEventDetails , context ) : undefined , executionFailedEventDetails : output . executionFailedEventDetails !== undefined && output . executionFailedEventDetails !== null ? deserializeAws_json1_0ExecutionFailedEventDetails ( output . executionFailedEventDetails , context ) : undefined , executionStartedEventDetails : output . executionStartedEventDetails !== undefined && output . executionStartedEventDetails !== null ? deserializeAws_json1_0ExecutionStartedEventDetails ( output . executionStartedEventDetails , context ) : undefined , executionSucceededEventDetails : output . executionSucceededEventDetails !== undefined && output . executionSucceededEventDetails !== null ? deserializeAws_json1_0ExecutionSucceededEventDetails ( output . executionSucceededEventDetails , context ) : undefined , executionTimedOutEventDetails : output . executionTimedOutEventDetails !== undefined && output . executionTimedOutEventDetails !== null ? deserializeAws_json1_0ExecutionTimedOutEventDetails ( output . executionTimedOutEventDetails , context ) : undefined , id : __expectLong ( output . id ) , lambdaFunctionFailedEventDetails : output . lambdaFunctionFailedEventDetails !== undefined && output . lambdaFunctionFailedEventDetails !== null ? deserializeAws_json1_0LambdaFunctionFailedEventDetails ( output . lambdaFunctionFailedEventDetails , context ) : undefined , lambdaFunctionScheduleFailedEventDetails : output . lambdaFunctionScheduleFailedEventDetails !== undefined && output . lambdaFunctionScheduleFailedEventDetails !== null ? deserializeAws_json1_0LambdaFunctionScheduleFailedEventDetails ( output . lambdaFunctionScheduleFailedEventDetails , context ) : undefined , lambdaFunctionScheduledEventDetails : output . lambdaFunctionScheduledEventDetails !== undefined && output . lambdaFunctionScheduledEventDetails !== null ? deserializeAws_json1_0LambdaFunctionScheduledEventDetails ( output . lambdaFunctionScheduledEventDetails , context ) : undefined , lambdaFunctionStartFailedEventDetails : output . lambdaFunctionStartFailedEventDetails !== undefined && output . lambdaFunctionStartFailedEventDetails !== null ? deserializeAws_json1_0LambdaFunctionStartFailedEventDetails ( output . lambdaFunctionStartFailedEventDetails , context ) : undefined , lambdaFunctionSucceededEventDetails : output . lambdaFunctionSucceededEventDetails !== undefined && output . lambdaFunctionSucceededEventDetails !== null ? deserializeAws_json1_0LambdaFunctionSucceededEventDetails ( output . lambdaFunctionSucceededEventDetails , context ) : undefined , lambdaFunctionTimedOutEventDetails : output . lambdaFunctionTimedOutEventDetails !== undefined && output . lambdaFunctionTimedOutEventDetails !== null ? deserializeAws_json1_0LambdaFunctionTimedOutEventDetails ( output . lambdaFunctionTimedOutEventDetails , context ) : undefined , mapIterationAbortedEventDetails : output . mapIterationAbortedEventDetails !== undefined && output . mapIterationAbortedEventDetails !== null ? deserializeAws_json1_0MapIterationEventDetails ( output . mapIterationAbortedEventDetails , context ) : undefined , mapIterationFailedEventDetails : output . mapIterationFailedEventDetails !== undefined && output . mapIterationFailedEventDetails !== null ? deserializeAws_json1_0MapIterationEventDetails ( output . mapIterationFailedEventDetails , context ) : undefined , mapIterationStartedEventDetails : output . mapIterationStartedEventDetails !== undefined && output . mapIterationStartedEventDetails !== null ? deserializeAws_json1_0MapIterationEventDetails ( output . mapIterationStartedEventDetails , context ) : undefined , mapIterationSucceededEventDetails : output . mapIterationSucceededEventDetails !== undefined && output . mapIterationSucceededEventDetails !== null ? deserializeAws_json1_0MapIterationEventDetails ( output . mapIterationSucceededEventDetails , context ) : undefined , mapStateStartedEventDetails : output . mapStateStartedEventDetails !== undefined && output . mapStateStartedEventDetails !== null ? deserializeAws_json1_0MapStateStartedEventDetails ( output . mapStateStartedEventDetails , context ) : undefined , previousEventId : __expectLong ( output . previousEventId ) , stateEnteredEventDetails : output . stateEnteredEventDetails !== undefined && output . stateEnteredEventDetails !== null ? deserializeAws_json1_0StateEnteredEventDetails ( output . stateEnteredEventDetails , context ) : undefined , stateExitedEventDetails : output . stateExitedEventDetails !== undefined && output . stateExitedEventDetails !== null ? deserializeAws_json1_0StateExitedEventDetails ( output . stateExitedEventDetails , context ) : undefined , taskFailedEventDetails : output . taskFailedEventDetails !== undefined && output . taskFailedEventDetails !== null ? deserializeAws_json1_0TaskFailedEventDetails ( output . taskFailedEventDetails , context ) : undefined , taskScheduledEventDetails : output . taskScheduledEventDetails !== undefined && output . taskScheduledEventDetails !== null ? deserializeAws_json1_0TaskScheduledEventDetails ( output . taskScheduledEventDetails , context ) : undefined , taskStartFailedEventDetails : output . taskStartFailedEventDetails !== undefined && output . taskStartFailedEventDetails !== null ? deserializeAws_json1_0TaskStartFailedEventDetails ( output . taskStartFailedEventDetails , context ) : undefined , taskStartedEventDetails : output . taskStartedEventDetails !== undefined && output . taskStartedEventDetails !== null ? deserializeAws_json1_0TaskStartedEventDetails ( output . taskStartedEventDetails , context ) : undefined , taskSubmitFailedEventDetails : output . taskSubmitFailedEventDetails !== undefined && output . taskSubmitFailedEventDetails !== null ? deserializeAws_json1_0TaskSubmitFailedEventDetails ( output . taskSubmitFailedEventDetails , context ) : undefined , taskSubmittedEventDetails : output . taskSubmittedEventDetails !== undefined && output . taskSubmittedEventDetails !== null ? deserializeAws_json1_0TaskSubmittedEventDetails ( output . taskSubmittedEventDetails , context ) : undefined , taskSucceededEventDetails : output . taskSucceededEventDetails !== undefined && output . taskSucceededEventDetails !== null ? deserializeAws_json1_0TaskSucceededEventDetails ( output . taskSucceededEventDetails , context ) : undefined , taskTimedOutEventDetails : output . taskTimedOutEventDetails !== undefined && output . taskTimedOutEventDetails !== null ? deserializeAws_json1_0TaskTimedOutEventDetails ( output . taskTimedOutEventDetails , context ) : undefined , timestamp : output . timestamp !== undefined && output . timestamp !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . timestamp ) ) ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_0HistoryEventExecutionDataDetails = ( output , context ) : HistoryEventExecutionDataDetails => { return { truncated : __expectBoolean ( output . truncated ) , } as any ; } ; const deserializeAws_json1_0HistoryEventList = ( output , context ) : HistoryEvent [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0HistoryEvent ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0InvalidArn = ( output , context ) : InvalidArn => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidDefinition = ( output , context ) : InvalidDefinition => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidExecutionInput = ( output , context ) : InvalidExecutionInput => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidLoggingConfiguration = ( output , context ) : InvalidLoggingConfiguration => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidName = ( output , context ) : InvalidName => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidOutput = ( output , context ) : InvalidOutput => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidToken = ( output , context ) : InvalidToken => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0InvalidTracingConfiguration = ( output , context ) : InvalidTracingConfiguration => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0LambdaFunctionFailedEventDetails = ( output , context ) : LambdaFunctionFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0LambdaFunctionScheduledEventDetails = ( output , context ) : LambdaFunctionScheduledEventDetails => { return { input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . inputDetails , context ) : undefined , resource : __expectString ( output . resource ) , timeoutInSeconds : __expectLong ( output . timeoutInSeconds ) , } as any ; } ; const deserializeAws_json1_0LambdaFunctionScheduleFailedEventDetails = ( output , context ) : LambdaFunctionScheduleFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0LambdaFunctionStartFailedEventDetails = ( output , context ) : LambdaFunctionStartFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0LambdaFunctionSucceededEventDetails = ( output , context ) : LambdaFunctionSucceededEventDetails => { return { output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_0LambdaFunctionTimedOutEventDetails = ( output , context ) : LambdaFunctionTimedOutEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , } as any ; } ; const deserializeAws_json1_0ListActivitiesOutput = ( output , context ) : ListActivitiesOutput => { return { activities : output . activities !== undefined && output . activities !== null ? deserializeAws_json1_0ActivityList ( output . activities , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_0ListExecutionsOutput = ( output , context ) : ListExecutionsOutput => { return { executions : output . executions !== undefined && output . executions !== null ? deserializeAws_json1_0ExecutionList ( output . executions , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_0ListStateMachinesOutput = ( output , context ) : ListStateMachinesOutput => { return { nextToken : __expectString ( output . nextToken ) , stateMachines : output . stateMachines !== undefined && output . stateMachines !== null ? deserializeAws_json1_0StateMachineList ( output . stateMachines , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListTagsForResourceOutput = ( output , context ) : ListTagsForResourceOutput => { return { tags : output . tags !== undefined && output . tags !== null ? deserializeAws_json1_0TagList ( output . tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_0LogDestination = ( output , context ) : LogDestination => { return { cloudWatchLogsLogGroup : output . cloudWatchLogsLogGroup !== undefined && output . cloudWatchLogsLogGroup !== null ? deserializeAws_json1_0CloudWatchLogsLogGroup ( output . cloudWatchLogsLogGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_0LogDestinationList = ( output , context ) : LogDestination [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0LogDestination ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0LoggingConfiguration = ( output , context ) : LoggingConfiguration => { return { destinations : output . destinations !== undefined && output . destinations !== null ? deserializeAws_json1_0LogDestinationList ( output . destinations , context ) : undefined , includeExecutionData : __expectBoolean ( output . includeExecutionData ) , level : __expectString ( output . level ) , } as any ; } ; const deserializeAws_json1_0MapIterationEventDetails = ( output , context ) : MapIterationEventDetails => { return { index : __expectInt32 ( output . index ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_0MapStateStartedEventDetails = ( output , context ) : MapStateStartedEventDetails => { return { length : __expectInt32 ( output . length ) , } as any ; } ; const deserializeAws_json1_0MissingRequiredParameter = ( output , context ) : MissingRequiredParameter => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ResourceNotFound = ( output , context ) : ResourceNotFound => { return { message : __expectString ( output . message ) , resourceName : __expectString ( output . resourceName ) , } as any ; } ; const deserializeAws_json1_0SendTaskFailureOutput = ( output , context ) : SendTaskFailureOutput => { return { } as any ; } ; const deserializeAws_json1_0SendTaskHeartbeatOutput = ( output , context ) : SendTaskHeartbeatOutput => { return { } as any ; } ; const deserializeAws_json1_0SendTaskSuccessOutput = ( output , context ) : SendTaskSuccessOutput => { return { } as any ; } ; const deserializeAws_json1_0StartExecutionOutput = ( output , context ) : StartExecutionOutput => { return { executionArn : __expectString ( output . executionArn ) , startDate : output . startDate !== undefined && output . startDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_0StartSyncExecutionOutput = ( output , context ) : StartSyncExecutionOutput => { return { billingDetails : output . billingDetails !== undefined && output . billingDetails !== null ? deserializeAws_json1_0BillingDetails ( output . billingDetails , context ) : undefined , cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , executionArn : __expectString ( output . executionArn ) , input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0CloudWatchEventsExecutionDataDetails ( output . inputDetails , context ) : undefined , name : __expectString ( output . name ) , output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0CloudWatchEventsExecutionDataDetails ( output . outputDetails , context ) : undefined , startDate : output . startDate !== undefined && output . startDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startDate ) ) ) : undefined , stateMachineArn : __expectString ( output . stateMachineArn ) , status : __expectString ( output . status ) , stopDate : output . stopDate !== undefined && output . stopDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopDate ) ) ) : undefined , traceHeader : __expectString ( output . traceHeader ) , } as any ; } ; const deserializeAws_json1_0StateEnteredEventDetails = ( output , context ) : StateEnteredEventDetails => { return { input : __expectString ( output . input ) , inputDetails : output . inputDetails !== undefined && output . inputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . inputDetails , context ) : undefined , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_0StateExitedEventDetails = ( output , context ) : StateExitedEventDetails => { return { name : __expectString ( output . name ) , output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_0StateMachineAlreadyExists = ( output , context ) : StateMachineAlreadyExists => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0StateMachineDeleting = ( output , context ) : StateMachineDeleting => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0StateMachineDoesNotExist = ( output , context ) : StateMachineDoesNotExist => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0StateMachineLimitExceeded = ( output , context ) : StateMachineLimitExceeded => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0StateMachineList = ( output , context ) : StateMachineListItem [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0StateMachineListItem ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0StateMachineListItem = ( output , context ) : StateMachineListItem => { return { creationDate : output . creationDate !== undefined && output . creationDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . creationDate ) ) ) : undefined , name : __expectString ( output . name ) , stateMachineArn : __expectString ( output . stateMachineArn ) , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_0StateMachineTypeNotSupported = ( output , context ) : StateMachineTypeNotSupported => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0StopExecutionOutput = ( output , context ) : StopExecutionOutput => { return { stopDate : output . stopDate !== undefined && output . stopDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopDate ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_0Tag = ( output , context ) : Tag => { return { key : __expectString ( output . key ) , value : __expectString ( output . value ) , } as any ; } ; const deserializeAws_json1_0TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0TagResourceOutput = ( output , context ) : TagResourceOutput => { return { } as any ; } ; const deserializeAws_json1_0TaskDoesNotExist = ( output , context ) : TaskDoesNotExist => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0TaskFailedEventDetails = ( output , context ) : TaskFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskScheduledEventDetails = ( output , context ) : TaskScheduledEventDetails => { return { heartbeatInSeconds : __expectLong ( output . heartbeatInSeconds ) , parameters : __expectString ( output . parameters ) , region : __expectString ( output . region ) , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , timeoutInSeconds : __expectLong ( output . timeoutInSeconds ) , } as any ; } ; const deserializeAws_json1_0TaskStartedEventDetails = ( output , context ) : TaskStartedEventDetails => { return { resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskStartFailedEventDetails = ( output , context ) : TaskStartFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskSubmitFailedEventDetails = ( output , context ) : TaskSubmitFailedEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskSubmittedEventDetails = ( output , context ) : TaskSubmittedEventDetails => { return { output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskSucceededEventDetails = ( output , context ) : TaskSucceededEventDetails => { return { output : __expectString ( output . output ) , outputDetails : output . outputDetails !== undefined && output . outputDetails !== null ? deserializeAws_json1_0HistoryEventExecutionDataDetails ( output . outputDetails , context ) : undefined , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TaskTimedOut = ( output , context ) : TaskTimedOut => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0TaskTimedOutEventDetails = ( output , context ) : TaskTimedOutEventDetails => { return { cause : __expectString ( output . cause ) , error : __expectString ( output . error ) , resource : __expectString ( output . resource ) , resourceType : __expectString ( output . resourceType ) , } as any ; } ; const deserializeAws_json1_0TooManyTags = ( output , context ) : TooManyTags => { return { message : __expectString ( output . message ) , resourceName : __expectString ( output . resourceName ) , } as any ; } ; const deserializeAws_json1_0TracingConfiguration = ( output , context ) : TracingConfiguration => { return { enabled : __expectBoolean ( output . enabled ) , } as any ; } ; const deserializeAws_json1_0UntagResourceOutput = ( output , context ) : UntagResourceOutput => { return { } as any ; } ; const deserializeAws_json1_0UpdateStateMachineOutput = ( output , context ) : UpdateStateMachineOutput => { return { updateDate : output . updateDate !== undefined && output . updateDate !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . updateDate ) ) ) : undefined , } 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 "" ; } ;