import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectObject as __expectObject , expectString as __expectString , extendedEncodeURIComponent as __extendedEncodeURIComponent , limitedParseFloat32 as __limitedParseFloat32 , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { v4 as generateIdempotencyToken } from "uuid" ; import { BatchDeleteWorldsCommandInput , BatchDeleteWorldsCommandOutput } from "../commands/BatchDeleteWorldsCommand" ; import { BatchDescribeSimulationJobCommandInput , BatchDescribeSimulationJobCommandOutput , } from "../commands/BatchDescribeSimulationJobCommand" ; import { CancelDeploymentJobCommandInput , CancelDeploymentJobCommandOutput , } from "../commands/CancelDeploymentJobCommand" ; import { CancelSimulationJobBatchCommandInput , CancelSimulationJobBatchCommandOutput , } from "../commands/CancelSimulationJobBatchCommand" ; import { CancelSimulationJobCommandInput , CancelSimulationJobCommandOutput , } from "../commands/CancelSimulationJobCommand" ; import { CancelWorldExportJobCommandInput , CancelWorldExportJobCommandOutput , } from "../commands/CancelWorldExportJobCommand" ; import { CancelWorldGenerationJobCommandInput , CancelWorldGenerationJobCommandOutput , } from "../commands/CancelWorldGenerationJobCommand" ; import { CreateDeploymentJobCommandInput , CreateDeploymentJobCommandOutput , } from "../commands/CreateDeploymentJobCommand" ; import { CreateFleetCommandInput , CreateFleetCommandOutput } from "../commands/CreateFleetCommand" ; import { CreateRobotApplicationCommandInput , CreateRobotApplicationCommandOutput , } from "../commands/CreateRobotApplicationCommand" ; import { CreateRobotApplicationVersionCommandInput , CreateRobotApplicationVersionCommandOutput , } from "../commands/CreateRobotApplicationVersionCommand" ; import { CreateRobotCommandInput , CreateRobotCommandOutput } from "../commands/CreateRobotCommand" ; import { CreateSimulationApplicationCommandInput , CreateSimulationApplicationCommandOutput , } from "../commands/CreateSimulationApplicationCommand" ; import { CreateSimulationApplicationVersionCommandInput , CreateSimulationApplicationVersionCommandOutput , } from "../commands/CreateSimulationApplicationVersionCommand" ; import { CreateSimulationJobCommandInput , CreateSimulationJobCommandOutput , } from "../commands/CreateSimulationJobCommand" ; import { CreateWorldExportJobCommandInput , CreateWorldExportJobCommandOutput , } from "../commands/CreateWorldExportJobCommand" ; import { CreateWorldGenerationJobCommandInput , CreateWorldGenerationJobCommandOutput , } from "../commands/CreateWorldGenerationJobCommand" ; import { CreateWorldTemplateCommandInput , CreateWorldTemplateCommandOutput , } from "../commands/CreateWorldTemplateCommand" ; import { DeleteFleetCommandInput , DeleteFleetCommandOutput } from "../commands/DeleteFleetCommand" ; import { DeleteRobotApplicationCommandInput , DeleteRobotApplicationCommandOutput , } from "../commands/DeleteRobotApplicationCommand" ; import { DeleteRobotCommandInput , DeleteRobotCommandOutput } from "../commands/DeleteRobotCommand" ; import { DeleteSimulationApplicationCommandInput , DeleteSimulationApplicationCommandOutput , } from "../commands/DeleteSimulationApplicationCommand" ; import { DeleteWorldTemplateCommandInput , DeleteWorldTemplateCommandOutput , } from "../commands/DeleteWorldTemplateCommand" ; import { DeregisterRobotCommandInput , DeregisterRobotCommandOutput } from "../commands/DeregisterRobotCommand" ; import { DescribeDeploymentJobCommandInput , DescribeDeploymentJobCommandOutput , } from "../commands/DescribeDeploymentJobCommand" ; import { DescribeFleetCommandInput , DescribeFleetCommandOutput } from "../commands/DescribeFleetCommand" ; import { DescribeRobotApplicationCommandInput , DescribeRobotApplicationCommandOutput , } from "../commands/DescribeRobotApplicationCommand" ; import { DescribeRobotCommandInput , DescribeRobotCommandOutput } from "../commands/DescribeRobotCommand" ; import { DescribeSimulationApplicationCommandInput , DescribeSimulationApplicationCommandOutput , } from "../commands/DescribeSimulationApplicationCommand" ; import { DescribeSimulationJobBatchCommandInput , DescribeSimulationJobBatchCommandOutput , } from "../commands/DescribeSimulationJobBatchCommand" ; import { DescribeSimulationJobCommandInput , DescribeSimulationJobCommandOutput , } from "../commands/DescribeSimulationJobCommand" ; import { DescribeWorldCommandInput , DescribeWorldCommandOutput } from "../commands/DescribeWorldCommand" ; import { DescribeWorldExportJobCommandInput , DescribeWorldExportJobCommandOutput , } from "../commands/DescribeWorldExportJobCommand" ; import { DescribeWorldGenerationJobCommandInput , DescribeWorldGenerationJobCommandOutput , } from "../commands/DescribeWorldGenerationJobCommand" ; import { DescribeWorldTemplateCommandInput , DescribeWorldTemplateCommandOutput , } from "../commands/DescribeWorldTemplateCommand" ; import { GetWorldTemplateBodyCommandInput , GetWorldTemplateBodyCommandOutput , } from "../commands/GetWorldTemplateBodyCommand" ; import { ListDeploymentJobsCommandInput , ListDeploymentJobsCommandOutput } from "../commands/ListDeploymentJobsCommand" ; import { ListFleetsCommandInput , ListFleetsCommandOutput } from "../commands/ListFleetsCommand" ; import { ListRobotApplicationsCommandInput , ListRobotApplicationsCommandOutput , } from "../commands/ListRobotApplicationsCommand" ; import { ListRobotsCommandInput , ListRobotsCommandOutput } from "../commands/ListRobotsCommand" ; import { ListSimulationApplicationsCommandInput , ListSimulationApplicationsCommandOutput , } from "../commands/ListSimulationApplicationsCommand" ; import { ListSimulationJobBatchesCommandInput , ListSimulationJobBatchesCommandOutput , } from "../commands/ListSimulationJobBatchesCommand" ; import { ListSimulationJobsCommandInput , ListSimulationJobsCommandOutput } from "../commands/ListSimulationJobsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { ListWorldExportJobsCommandInput , ListWorldExportJobsCommandOutput , } from "../commands/ListWorldExportJobsCommand" ; import { ListWorldGenerationJobsCommandInput , ListWorldGenerationJobsCommandOutput , } from "../commands/ListWorldGenerationJobsCommand" ; import { ListWorldsCommandInput , ListWorldsCommandOutput } from "../commands/ListWorldsCommand" ; import { ListWorldTemplatesCommandInput , ListWorldTemplatesCommandOutput } from "../commands/ListWorldTemplatesCommand" ; import { RegisterRobotCommandInput , RegisterRobotCommandOutput } from "../commands/RegisterRobotCommand" ; import { RestartSimulationJobCommandInput , RestartSimulationJobCommandOutput , } from "../commands/RestartSimulationJobCommand" ; import { StartSimulationJobBatchCommandInput , StartSimulationJobBatchCommandOutput , } from "../commands/StartSimulationJobBatchCommand" ; import { SyncDeploymentJobCommandInput , SyncDeploymentJobCommandOutput } from "../commands/SyncDeploymentJobCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateRobotApplicationCommandInput , UpdateRobotApplicationCommandOutput , } from "../commands/UpdateRobotApplicationCommand" ; import { UpdateSimulationApplicationCommandInput , UpdateSimulationApplicationCommandOutput , } from "../commands/UpdateSimulationApplicationCommand" ; import { UpdateWorldTemplateCommandInput , UpdateWorldTemplateCommandOutput , } from "../commands/UpdateWorldTemplateCommand" ; import { BatchPolicy , Compute , ComputeResponse , ConcurrentDeploymentException , DataSource , DataSourceConfig , DeploymentApplicationConfig , DeploymentConfig , DeploymentJob , DeploymentLaunchConfig , Environment , FailedCreateSimulationJobRequest , FailureSummary , Filter , FinishedWorldsSummary , Fleet , IdempotentParameterMismatchException , InternalServerException , InvalidParameterException , LaunchConfig , LimitExceededException , LoggingConfig , NetworkInterface , OutputLocation , PortForwardingConfig , PortMapping , ProgressDetail , RenderingEngine , ResourceAlreadyExistsException , ResourceNotFoundException , Robot , RobotApplicationConfig , RobotApplicationSummary , RobotDeployment , RobotSoftwareSuite , S3KeyOutput , S3Object , ServiceUnavailableException , SimulationApplicationConfig , SimulationApplicationSummary , SimulationJob , SimulationJobBatchSummary , SimulationJobRequest , SimulationJobSummary , SimulationSoftwareSuite , Source , SourceConfig , TemplateLocation , TemplateSummary , ThrottlingException , Tool , UploadConfiguration , VPCConfig , VPCConfigResponse , WorldConfig , WorldCount , WorldExportJobSummary , WorldFailure , WorldGenerationJobSummary , WorldSummary , } from "../models/models_0" ; export const serializeAws_restJson1BatchDeleteWorldsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/batchDeleteWorlds" ; let body ; body = JSON . stringify ( { ... ( input . worlds !== undefined && input . worlds !== null && { worlds : serializeAws_restJson1Arns ( input . worlds , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1BatchDescribeSimulationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/batchDescribeSimulationJob" ; let body ; body = JSON . stringify ( { ... ( input . jobs !== undefined && input . jobs !== null && { jobs : serializeAws_restJson1Arns ( input . jobs , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CancelDeploymentJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/cancelDeploymentJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CancelSimulationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/cancelSimulationJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CancelSimulationJobBatchCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/cancelSimulationJobBatch" ; let body ; body = JSON . stringify ( { ... ( input . batch !== undefined && input . batch !== null && { batch : input . batch } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CancelWorldExportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/cancelWorldExportJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CancelWorldGenerationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/cancelWorldGenerationJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateDeploymentJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createDeploymentJob" ; let body ; body = JSON . stringify ( { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . deploymentApplicationConfigs !== undefined && input . deploymentApplicationConfigs !== null && { deploymentApplicationConfigs : serializeAws_restJson1DeploymentApplicationConfigs ( input . deploymentApplicationConfigs , context ) , } ) , ... ( input . deploymentConfig !== undefined && input . deploymentConfig !== null && { deploymentConfig : serializeAws_restJson1DeploymentConfig ( input . deploymentConfig , context ) , } ) , ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateFleetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createFleet" ; let body ; body = JSON . stringify ( { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateRobotCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createRobot" ; let body ; body = JSON . stringify ( { ... ( input . architecture !== undefined && input . architecture !== null && { architecture : input . architecture } ) , ... ( input . greengrassGroupId !== undefined && input . greengrassGroupId !== null && { greengrassGroupId : input . greengrassGroupId } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateRobotApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createRobotApplication" ; let body ; body = JSON . stringify ( { ... ( input . environment !== undefined && input . environment !== null && { environment : serializeAws_restJson1Environment ( input . environment , context ) } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . robotSoftwareSuite !== undefined && input . robotSoftwareSuite !== null && { robotSoftwareSuite : serializeAws_restJson1RobotSoftwareSuite ( input . robotSoftwareSuite , context ) , } ) , ... ( input . sources !== undefined && input . sources !== null && { sources : serializeAws_restJson1SourceConfigs ( input . sources , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateRobotApplicationVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createRobotApplicationVersion" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . currentRevisionId !== undefined && input . currentRevisionId !== null && { currentRevisionId : input . currentRevisionId } ) , ... ( input . imageDigest !== undefined && input . imageDigest !== null && { imageDigest : input . imageDigest } ) , ... ( input . s3Etags !== undefined && input . s3Etags !== null && { s3Etags : serializeAws_restJson1S3Etags ( input . s3Etags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateSimulationApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createSimulationApplication" ; let body ; body = JSON . stringify ( { ... ( input . environment !== undefined && input . environment !== null && { environment : serializeAws_restJson1Environment ( input . environment , context ) } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . renderingEngine !== undefined && input . renderingEngine !== null && { renderingEngine : serializeAws_restJson1RenderingEngine ( input . renderingEngine , context ) , } ) , ... ( input . robotSoftwareSuite !== undefined && input . robotSoftwareSuite !== null && { robotSoftwareSuite : serializeAws_restJson1RobotSoftwareSuite ( input . robotSoftwareSuite , context ) , } ) , ... ( input . simulationSoftwareSuite !== undefined && input . simulationSoftwareSuite !== null && { simulationSoftwareSuite : serializeAws_restJson1SimulationSoftwareSuite ( input . simulationSoftwareSuite , context ) , } ) , ... ( input . sources !== undefined && input . sources !== null && { sources : serializeAws_restJson1SourceConfigs ( input . sources , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateSimulationApplicationVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createSimulationApplicationVersion" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . currentRevisionId !== undefined && input . currentRevisionId !== null && { currentRevisionId : input . currentRevisionId } ) , ... ( input . imageDigest !== undefined && input . imageDigest !== null && { imageDigest : input . imageDigest } ) , ... ( input . s3Etags !== undefined && input . s3Etags !== null && { s3Etags : serializeAws_restJson1S3Etags ( input . s3Etags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateSimulationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createSimulationJob" ; let body ; body = JSON . stringify ( { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . compute !== undefined && input . compute !== null && { compute : serializeAws_restJson1Compute ( input . compute , context ) } ) , ... ( input . dataSources !== undefined && input . dataSources !== null && { dataSources : serializeAws_restJson1DataSourceConfigs ( input . dataSources , context ) , } ) , ... ( input . failureBehavior !== undefined && input . failureBehavior !== null && { failureBehavior : input . failureBehavior } ) , ... ( input . iamRole !== undefined && input . iamRole !== null && { iamRole : input . iamRole } ) , ... ( input . loggingConfig !== undefined && input . loggingConfig !== null && { loggingConfig : serializeAws_restJson1LoggingConfig ( input . loggingConfig , context ) , } ) , ... ( input . maxJobDurationInSeconds !== undefined && input . maxJobDurationInSeconds !== null && { maxJobDurationInSeconds : input . maxJobDurationInSeconds } ) , ... ( input . outputLocation !== undefined && input . outputLocation !== null && { outputLocation : serializeAws_restJson1OutputLocation ( input . outputLocation , context ) , } ) , ... ( input . robotApplications !== undefined && input . robotApplications !== null && { robotApplications : serializeAws_restJson1RobotApplicationConfigs ( input . robotApplications , context ) , } ) , ... ( input . simulationApplications !== undefined && input . simulationApplications !== null && { simulationApplications : serializeAws_restJson1SimulationApplicationConfigs ( input . simulationApplications , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , ... ( input . vpcConfig !== undefined && input . vpcConfig !== null && { vpcConfig : serializeAws_restJson1VPCConfig ( input . vpcConfig , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateWorldExportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createWorldExportJob" ; let body ; body = JSON . stringify ( { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . iamRole !== undefined && input . iamRole !== null && { iamRole : input . iamRole } ) , ... ( input . outputLocation !== undefined && input . outputLocation !== null && { outputLocation : serializeAws_restJson1OutputLocation ( input . outputLocation , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , ... ( input . worlds !== undefined && input . worlds !== null && { worlds : serializeAws_restJson1Arns ( input . worlds , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateWorldGenerationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createWorldGenerationJob" ; let body ; body = JSON . stringify ( { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , ... ( input . template !== undefined && input . template !== null && { template : input . template } ) , ... ( input . worldCount !== undefined && input . worldCount !== null && { worldCount : serializeAws_restJson1WorldCount ( input . worldCount , context ) } ) , ... ( input . worldTags !== undefined && input . worldTags !== null && { worldTags : serializeAws_restJson1TagMap ( input . worldTags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateWorldTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/createWorldTemplate" ; let body ; body = JSON . stringify ( { ... ( input . clientRequestToken !== undefined && input . clientRequestToken !== null && { clientRequestToken : input . clientRequestToken } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , ... ( input . templateBody !== undefined && input . templateBody !== null && { templateBody : input . templateBody } ) , ... ( input . templateLocation !== undefined && input . templateLocation !== null && { templateLocation : serializeAws_restJson1TemplateLocation ( input . templateLocation , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteFleetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deleteFleet" ; let body ; body = JSON . stringify ( { ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteRobotCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deleteRobot" ; let body ; body = JSON . stringify ( { ... ( input . robot !== undefined && input . robot !== null && { robot : input . robot } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteRobotApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deleteRobotApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteSimulationApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deleteSimulationApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteWorldTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deleteWorldTemplate" ; let body ; body = JSON . stringify ( { ... ( input . template !== undefined && input . template !== null && { template : input . template } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeregisterRobotCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/deregisterRobot" ; let body ; body = JSON . stringify ( { ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , ... ( input . robot !== undefined && input . robot !== null && { robot : input . robot } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDeploymentJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeDeploymentJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeFleetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeFleet" ; let body ; body = JSON . stringify ( { ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeRobotCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeRobot" ; let body ; body = JSON . stringify ( { ... ( input . robot !== undefined && input . robot !== null && { robot : input . robot } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeRobotApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeRobotApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeSimulationApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeSimulationApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeSimulationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeSimulationJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeSimulationJobBatchCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeSimulationJobBatch" ; let body ; body = JSON . stringify ( { ... ( input . batch !== undefined && input . batch !== null && { batch : input . batch } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeWorldCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeWorld" ; let body ; body = JSON . stringify ( { ... ( input . world !== undefined && input . world !== null && { world : input . world } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeWorldExportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeWorldExportJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeWorldGenerationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeWorldGenerationJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeWorldTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/describeWorldTemplate" ; let body ; body = JSON . stringify ( { ... ( input . template !== undefined && input . template !== null && { template : input . template } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1GetWorldTemplateBodyCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/getWorldTemplateBody" ; let body ; body = JSON . stringify ( { ... ( input . generationJob !== undefined && input . generationJob !== null && { generationJob : input . generationJob } ) , ... ( input . template !== undefined && input . template !== null && { template : input . template } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListDeploymentJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listDeploymentJobs" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListFleetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listFleets" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListRobotApplicationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listRobotApplications" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . versionQualifier !== undefined && input . versionQualifier !== null && { versionQualifier : input . versionQualifier } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListRobotsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listRobots" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListSimulationApplicationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listSimulationApplications" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . versionQualifier !== undefined && input . versionQualifier !== null && { versionQualifier : input . versionQualifier } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListSimulationJobBatchesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listSimulationJobBatches" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListSimulationJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listSimulationJobs" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/tags/{resourceArn}" ; if ( input . resourceArn !== undefined ) { const labelValue = input . resourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: resourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{resourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: resourceArn." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListWorldExportJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listWorldExportJobs" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListWorldGenerationJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listWorldGenerationJobs" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListWorldsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listWorlds" ; let body ; body = JSON . stringify ( { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_restJson1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListWorldTemplatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/listWorldTemplates" ; let body ; body = JSON . stringify ( { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1RegisterRobotCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/registerRobot" ; let body ; body = JSON . stringify ( { ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , ... ( input . robot !== undefined && input . robot !== null && { robot : input . robot } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1RestartSimulationJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/restartSimulationJob" ; let body ; body = JSON . stringify ( { ... ( input . job !== undefined && input . job !== null && { job : input . job } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1StartSimulationJobBatchCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/startSimulationJobBatch" ; let body ; body = JSON . stringify ( { ... ( input . batchPolicy !== undefined && input . batchPolicy !== null && { batchPolicy : serializeAws_restJson1BatchPolicy ( input . batchPolicy , context ) } ) , clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . createSimulationJobRequests !== undefined && input . createSimulationJobRequests !== null && { createSimulationJobRequests : serializeAws_restJson1CreateSimulationJobRequests ( input . createSimulationJobRequests , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1SyncDeploymentJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/syncDeploymentJob" ; let body ; body = JSON . stringify ( { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . fleet !== undefined && input . fleet !== null && { fleet : input . fleet } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/tags/{resourceArn}" ; if ( input . resourceArn !== undefined ) { const labelValue = input . resourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: resourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{resourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: resourceArn." ) ; } let body ; body = JSON . stringify ( { ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/tags/{resourceArn}" ; if ( input . resourceArn !== undefined ) { const labelValue = input . resourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: resourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{resourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: resourceArn." ) ; } const query = { ... ( input . tagKeys !== undefined && { tagKeys : ( input . tagKeys || [ ] ) . map ( ( _entry ) => _entry as any ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1UpdateRobotApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/updateRobotApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . currentRevisionId !== undefined && input . currentRevisionId !== null && { currentRevisionId : input . currentRevisionId } ) , ... ( input . environment !== undefined && input . environment !== null && { environment : serializeAws_restJson1Environment ( input . environment , context ) } ) , ... ( input . robotSoftwareSuite !== undefined && input . robotSoftwareSuite !== null && { robotSoftwareSuite : serializeAws_restJson1RobotSoftwareSuite ( input . robotSoftwareSuite , context ) , } ) , ... ( input . sources !== undefined && input . sources !== null && { sources : serializeAws_restJson1SourceConfigs ( input . sources , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateSimulationApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/updateSimulationApplication" ; let body ; body = JSON . stringify ( { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . currentRevisionId !== undefined && input . currentRevisionId !== null && { currentRevisionId : input . currentRevisionId } ) , ... ( input . environment !== undefined && input . environment !== null && { environment : serializeAws_restJson1Environment ( input . environment , context ) } ) , ... ( input . renderingEngine !== undefined && input . renderingEngine !== null && { renderingEngine : serializeAws_restJson1RenderingEngine ( input . renderingEngine , context ) , } ) , ... ( input . robotSoftwareSuite !== undefined && input . robotSoftwareSuite !== null && { robotSoftwareSuite : serializeAws_restJson1RobotSoftwareSuite ( input . robotSoftwareSuite , context ) , } ) , ... ( input . simulationSoftwareSuite !== undefined && input . simulationSoftwareSuite !== null && { simulationSoftwareSuite : serializeAws_restJson1SimulationSoftwareSuite ( input . simulationSoftwareSuite , context ) , } ) , ... ( input . sources !== undefined && input . sources !== null && { sources : serializeAws_restJson1SourceConfigs ( input . sources , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateWorldTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; const resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/updateWorldTemplate" ; let body ; body = JSON . stringify ( { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . template !== undefined && input . template !== null && { template : input . template } ) , ... ( input . templateBody !== undefined && input . templateBody !== null && { templateBody : input . templateBody } ) , ... ( input . templateLocation !== undefined && input . templateLocation !== null && { templateLocation : serializeAws_restJson1TemplateLocation ( input . templateLocation , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const deserializeAws_restJson1BatchDeleteWorldsCommand = async ( output , context ) : Promise < BatchDeleteWorldsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1BatchDeleteWorldsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , unprocessedWorlds : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . unprocessedWorlds !== undefined && data . unprocessedWorlds !== null ) { contents . unprocessedWorlds = deserializeAws_restJson1Arns ( data . unprocessedWorlds , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1BatchDeleteWorldsCommandError = async ( output , context ) : Promise < BatchDeleteWorldsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1BatchDescribeSimulationJobCommand = async ( output , context ) : Promise < BatchDescribeSimulationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1BatchDescribeSimulationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , jobs : undefined , unprocessedJobs : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . jobs !== undefined && data . jobs !== null ) { contents . jobs = deserializeAws_restJson1SimulationJobs ( data . jobs , context ) ; } if ( data . unprocessedJobs !== undefined && data . unprocessedJobs !== null ) { contents . unprocessedJobs = deserializeAws_restJson1Arns ( data . unprocessedJobs , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1BatchDescribeSimulationJobCommandError = async ( output , context ) : Promise < BatchDescribeSimulationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CancelDeploymentJobCommand = async ( output , context ) : Promise < CancelDeploymentJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelDeploymentJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelDeploymentJobCommandError = async ( output , context ) : Promise < CancelDeploymentJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CancelSimulationJobCommand = async ( output , context ) : Promise < CancelSimulationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelSimulationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelSimulationJobCommandError = async ( output , context ) : Promise < CancelSimulationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CancelSimulationJobBatchCommand = async ( output , context ) : Promise < CancelSimulationJobBatchCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelSimulationJobBatchCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelSimulationJobBatchCommandError = async ( output , context ) : Promise < CancelSimulationJobBatchCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CancelWorldExportJobCommand = async ( output , context ) : Promise < CancelWorldExportJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelWorldExportJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelWorldExportJobCommandError = async ( output , context ) : Promise < CancelWorldExportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CancelWorldGenerationJobCommand = async ( output , context ) : Promise < CancelWorldGenerationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelWorldGenerationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelWorldGenerationJobCommandError = async ( output , context ) : Promise < CancelWorldGenerationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateDeploymentJobCommand = async ( output , context ) : Promise < CreateDeploymentJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateDeploymentJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , deploymentApplicationConfigs : undefined , deploymentConfig : undefined , failureCode : undefined , failureReason : undefined , fleet : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . deploymentApplicationConfigs !== undefined && data . deploymentApplicationConfigs !== null ) { contents . deploymentApplicationConfigs = deserializeAws_restJson1DeploymentApplicationConfigs ( data . deploymentApplicationConfigs , context ) ; } if ( data . deploymentConfig !== undefined && data . deploymentConfig !== null ) { contents . deploymentConfig = deserializeAws_restJson1DeploymentConfig ( data . deploymentConfig , context ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . fleet !== undefined && data . fleet !== null ) { contents . fleet = __expectString ( data . fleet ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateDeploymentJobCommandError = async ( output , context ) : Promise < CreateDeploymentJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentDeploymentException" : case "com.amazonaws.robomaker#ConcurrentDeploymentException" : response = { ... ( await deserializeAws_restJson1ConcurrentDeploymentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateFleetCommand = async ( output , context ) : Promise < CreateFleetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateFleetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , name : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateFleetCommandError = async ( output , context ) : Promise < CreateFleetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateRobotCommand = async ( output , context ) : Promise < CreateRobotCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateRobotCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , architecture : undefined , arn : undefined , createdAt : undefined , greengrassGroupId : undefined , name : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . architecture !== undefined && data . architecture !== null ) { contents . architecture = __expectString ( data . architecture ) ; } if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . greengrassGroupId !== undefined && data . greengrassGroupId !== null ) { contents . greengrassGroupId = __expectString ( data . greengrassGroupId ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateRobotCommandError = async ( output , context ) : Promise < CreateRobotCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.robomaker#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateRobotApplicationCommand = async ( output , context ) : Promise < CreateRobotApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateRobotApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , revisionId : undefined , robotSoftwareSuite : undefined , sources : undefined , tags : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateRobotApplicationCommandError = async ( output , context ) : Promise < CreateRobotApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.robomaker#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateRobotApplicationVersionCommand = async ( output , context ) : Promise < CreateRobotApplicationVersionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateRobotApplicationVersionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , revisionId : undefined , robotSoftwareSuite : undefined , sources : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateRobotApplicationVersionCommandError = async ( output , context ) : Promise < CreateRobotApplicationVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateSimulationApplicationCommand = async ( output , context ) : Promise < CreateSimulationApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateSimulationApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , renderingEngine : undefined , revisionId : undefined , robotSoftwareSuite : undefined , simulationSoftwareSuite : undefined , sources : undefined , tags : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . renderingEngine !== undefined && data . renderingEngine !== null ) { contents . renderingEngine = deserializeAws_restJson1RenderingEngine ( data . renderingEngine , context ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . simulationSoftwareSuite !== undefined && data . simulationSoftwareSuite !== null ) { contents . simulationSoftwareSuite = deserializeAws_restJson1SimulationSoftwareSuite ( data . simulationSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateSimulationApplicationCommandError = async ( output , context ) : Promise < CreateSimulationApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.robomaker#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateSimulationApplicationVersionCommand = async ( output , context ) : Promise < CreateSimulationApplicationVersionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateSimulationApplicationVersionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , renderingEngine : undefined , revisionId : undefined , robotSoftwareSuite : undefined , simulationSoftwareSuite : undefined , sources : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . renderingEngine !== undefined && data . renderingEngine !== null ) { contents . renderingEngine = deserializeAws_restJson1RenderingEngine ( data . renderingEngine , context ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . simulationSoftwareSuite !== undefined && data . simulationSoftwareSuite !== null ) { contents . simulationSoftwareSuite = deserializeAws_restJson1SimulationSoftwareSuite ( data . simulationSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateSimulationApplicationVersionCommandError = async ( output , context ) : Promise < CreateSimulationApplicationVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateSimulationJobCommand = async ( output , context ) : Promise < CreateSimulationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateSimulationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , compute : undefined , dataSources : undefined , failureBehavior : undefined , failureCode : undefined , iamRole : undefined , lastStartedAt : undefined , lastUpdatedAt : undefined , loggingConfig : undefined , maxJobDurationInSeconds : undefined , outputLocation : undefined , robotApplications : undefined , simulationApplications : undefined , simulationTimeMillis : undefined , status : undefined , tags : undefined , vpcConfig : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . compute !== undefined && data . compute !== null ) { contents . compute = deserializeAws_restJson1ComputeResponse ( data . compute , context ) ; } if ( data . dataSources !== undefined && data . dataSources !== null ) { contents . dataSources = deserializeAws_restJson1DataSources ( data . dataSources , context ) ; } if ( data . failureBehavior !== undefined && data . failureBehavior !== null ) { contents . failureBehavior = __expectString ( data . failureBehavior ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . iamRole !== undefined && data . iamRole !== null ) { contents . iamRole = __expectString ( data . iamRole ) ; } if ( data . lastStartedAt !== undefined && data . lastStartedAt !== null ) { contents . lastStartedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastStartedAt ) ) ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . loggingConfig !== undefined && data . loggingConfig !== null ) { contents . loggingConfig = deserializeAws_restJson1LoggingConfig ( data . loggingConfig , context ) ; } if ( data . maxJobDurationInSeconds !== undefined && data . maxJobDurationInSeconds !== null ) { contents . maxJobDurationInSeconds = __expectLong ( data . maxJobDurationInSeconds ) ; } if ( data . outputLocation !== undefined && data . outputLocation !== null ) { contents . outputLocation = deserializeAws_restJson1OutputLocation ( data . outputLocation , context ) ; } if ( data . robotApplications !== undefined && data . robotApplications !== null ) { contents . robotApplications = deserializeAws_restJson1RobotApplicationConfigs ( data . robotApplications , context ) ; } if ( data . simulationApplications !== undefined && data . simulationApplications !== null ) { contents . simulationApplications = deserializeAws_restJson1SimulationApplicationConfigs ( data . simulationApplications , context ) ; } if ( data . simulationTimeMillis !== undefined && data . simulationTimeMillis !== null ) { contents . simulationTimeMillis = __expectLong ( data . simulationTimeMillis ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . vpcConfig !== undefined && data . vpcConfig !== null ) { contents . vpcConfig = deserializeAws_restJson1VPCConfigResponse ( data . vpcConfig , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateSimulationJobCommandError = async ( output , context ) : Promise < CreateSimulationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceUnavailableException" : case "com.amazonaws.robomaker#ServiceUnavailableException" : response = { ... ( await deserializeAws_restJson1ServiceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateWorldExportJobCommand = async ( output , context ) : Promise < CreateWorldExportJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateWorldExportJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , failureCode : undefined , iamRole : undefined , outputLocation : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . iamRole !== undefined && data . iamRole !== null ) { contents . iamRole = __expectString ( data . iamRole ) ; } if ( data . outputLocation !== undefined && data . outputLocation !== null ) { contents . outputLocation = deserializeAws_restJson1OutputLocation ( data . outputLocation , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateWorldExportJobCommandError = async ( output , context ) : Promise < CreateWorldExportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceUnavailableException" : case "com.amazonaws.robomaker#ServiceUnavailableException" : response = { ... ( await deserializeAws_restJson1ServiceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateWorldGenerationJobCommand = async ( output , context ) : Promise < CreateWorldGenerationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateWorldGenerationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , failureCode : undefined , status : undefined , tags : undefined , template : undefined , worldCount : undefined , worldTags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . template !== undefined && data . template !== null ) { contents . template = __expectString ( data . template ) ; } if ( data . worldCount !== undefined && data . worldCount !== null ) { contents . worldCount = deserializeAws_restJson1WorldCount ( data . worldCount , context ) ; } if ( data . worldTags !== undefined && data . worldTags !== null ) { contents . worldTags = deserializeAws_restJson1TagMap ( data . worldTags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateWorldGenerationJobCommandError = async ( output , context ) : Promise < CreateWorldGenerationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceUnavailableException" : case "com.amazonaws.robomaker#ServiceUnavailableException" : response = { ... ( await deserializeAws_restJson1ServiceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateWorldTemplateCommand = async ( output , context ) : Promise < CreateWorldTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateWorldTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , name : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateWorldTemplateCommandError = async ( output , context ) : Promise < CreateWorldTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.robomaker#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteFleetCommand = async ( output , context ) : Promise < DeleteFleetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteFleetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteFleetCommandError = async ( output , context ) : Promise < DeleteFleetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteRobotCommand = async ( output , context ) : Promise < DeleteRobotCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteRobotCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteRobotCommandError = async ( output , context ) : Promise < DeleteRobotCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteRobotApplicationCommand = async ( output , context ) : Promise < DeleteRobotApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteRobotApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteRobotApplicationCommandError = async ( output , context ) : Promise < DeleteRobotApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteSimulationApplicationCommand = async ( output , context ) : Promise < DeleteSimulationApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteSimulationApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteSimulationApplicationCommandError = async ( output , context ) : Promise < DeleteSimulationApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteWorldTemplateCommand = async ( output , context ) : Promise < DeleteWorldTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteWorldTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteWorldTemplateCommandError = async ( output , context ) : Promise < DeleteWorldTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeregisterRobotCommand = async ( output , context ) : Promise < DeregisterRobotCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeregisterRobotCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , fleet : undefined , robot : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . fleet !== undefined && data . fleet !== null ) { contents . fleet = __expectString ( data . fleet ) ; } if ( data . robot !== undefined && data . robot !== null ) { contents . robot = __expectString ( data . robot ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeregisterRobotCommandError = async ( output , context ) : Promise < DeregisterRobotCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeDeploymentJobCommand = async ( output , context ) : Promise < DescribeDeploymentJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDeploymentJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , deploymentApplicationConfigs : undefined , deploymentConfig : undefined , failureCode : undefined , failureReason : undefined , fleet : undefined , robotDeploymentSummary : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . deploymentApplicationConfigs !== undefined && data . deploymentApplicationConfigs !== null ) { contents . deploymentApplicationConfigs = deserializeAws_restJson1DeploymentApplicationConfigs ( data . deploymentApplicationConfigs , context ) ; } if ( data . deploymentConfig !== undefined && data . deploymentConfig !== null ) { contents . deploymentConfig = deserializeAws_restJson1DeploymentConfig ( data . deploymentConfig , context ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . fleet !== undefined && data . fleet !== null ) { contents . fleet = __expectString ( data . fleet ) ; } if ( data . robotDeploymentSummary !== undefined && data . robotDeploymentSummary !== null ) { contents . robotDeploymentSummary = deserializeAws_restJson1RobotDeploymentSummary ( data . robotDeploymentSummary , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDeploymentJobCommandError = async ( output , context ) : Promise < DescribeDeploymentJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeFleetCommand = async ( output , context ) : Promise < DescribeFleetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeFleetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , lastDeploymentJob : undefined , lastDeploymentStatus : undefined , lastDeploymentTime : undefined , name : undefined , robots : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . lastDeploymentJob !== undefined && data . lastDeploymentJob !== null ) { contents . lastDeploymentJob = __expectString ( data . lastDeploymentJob ) ; } if ( data . lastDeploymentStatus !== undefined && data . lastDeploymentStatus !== null ) { contents . lastDeploymentStatus = __expectString ( data . lastDeploymentStatus ) ; } if ( data . lastDeploymentTime !== undefined && data . lastDeploymentTime !== null ) { contents . lastDeploymentTime = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastDeploymentTime ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . robots !== undefined && data . robots !== null ) { contents . robots = deserializeAws_restJson1Robots ( data . robots , context ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeFleetCommandError = async ( output , context ) : Promise < DescribeFleetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeRobotCommand = async ( output , context ) : Promise < DescribeRobotCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeRobotCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , architecture : undefined , arn : undefined , createdAt : undefined , fleetArn : undefined , greengrassGroupId : undefined , lastDeploymentJob : undefined , lastDeploymentTime : undefined , name : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . architecture !== undefined && data . architecture !== null ) { contents . architecture = __expectString ( data . architecture ) ; } if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . fleetArn !== undefined && data . fleetArn !== null ) { contents . fleetArn = __expectString ( data . fleetArn ) ; } if ( data . greengrassGroupId !== undefined && data . greengrassGroupId !== null ) { contents . greengrassGroupId = __expectString ( data . greengrassGroupId ) ; } if ( data . lastDeploymentJob !== undefined && data . lastDeploymentJob !== null ) { contents . lastDeploymentJob = __expectString ( data . lastDeploymentJob ) ; } if ( data . lastDeploymentTime !== undefined && data . lastDeploymentTime !== null ) { contents . lastDeploymentTime = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastDeploymentTime ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeRobotCommandError = async ( output , context ) : Promise < DescribeRobotCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeRobotApplicationCommand = async ( output , context ) : Promise < DescribeRobotApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeRobotApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , imageDigest : undefined , lastUpdatedAt : undefined , name : undefined , revisionId : undefined , robotSoftwareSuite : undefined , sources : undefined , tags : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . imageDigest !== undefined && data . imageDigest !== null ) { contents . imageDigest = __expectString ( data . imageDigest ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeRobotApplicationCommandError = async ( output , context ) : Promise < DescribeRobotApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeSimulationApplicationCommand = async ( output , context ) : Promise < DescribeSimulationApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeSimulationApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , imageDigest : undefined , lastUpdatedAt : undefined , name : undefined , renderingEngine : undefined , revisionId : undefined , robotSoftwareSuite : undefined , simulationSoftwareSuite : undefined , sources : undefined , tags : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . imageDigest !== undefined && data . imageDigest !== null ) { contents . imageDigest = __expectString ( data . imageDigest ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . renderingEngine !== undefined && data . renderingEngine !== null ) { contents . renderingEngine = deserializeAws_restJson1RenderingEngine ( data . renderingEngine , context ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . simulationSoftwareSuite !== undefined && data . simulationSoftwareSuite !== null ) { contents . simulationSoftwareSuite = deserializeAws_restJson1SimulationSoftwareSuite ( data . simulationSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeSimulationApplicationCommandError = async ( output , context ) : Promise < DescribeSimulationApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeSimulationJobCommand = async ( output , context ) : Promise < DescribeSimulationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeSimulationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , compute : undefined , dataSources : undefined , failureBehavior : undefined , failureCode : undefined , failureReason : undefined , iamRole : undefined , lastStartedAt : undefined , lastUpdatedAt : undefined , loggingConfig : undefined , maxJobDurationInSeconds : undefined , name : undefined , networkInterface : undefined , outputLocation : undefined , robotApplications : undefined , simulationApplications : undefined , simulationTimeMillis : undefined , status : undefined , tags : undefined , vpcConfig : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . compute !== undefined && data . compute !== null ) { contents . compute = deserializeAws_restJson1ComputeResponse ( data . compute , context ) ; } if ( data . dataSources !== undefined && data . dataSources !== null ) { contents . dataSources = deserializeAws_restJson1DataSources ( data . dataSources , context ) ; } if ( data . failureBehavior !== undefined && data . failureBehavior !== null ) { contents . failureBehavior = __expectString ( data . failureBehavior ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . iamRole !== undefined && data . iamRole !== null ) { contents . iamRole = __expectString ( data . iamRole ) ; } if ( data . lastStartedAt !== undefined && data . lastStartedAt !== null ) { contents . lastStartedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastStartedAt ) ) ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . loggingConfig !== undefined && data . loggingConfig !== null ) { contents . loggingConfig = deserializeAws_restJson1LoggingConfig ( data . loggingConfig , context ) ; } if ( data . maxJobDurationInSeconds !== undefined && data . maxJobDurationInSeconds !== null ) { contents . maxJobDurationInSeconds = __expectLong ( data . maxJobDurationInSeconds ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . networkInterface !== undefined && data . networkInterface !== null ) { contents . networkInterface = deserializeAws_restJson1NetworkInterface ( data . networkInterface , context ) ; } if ( data . outputLocation !== undefined && data . outputLocation !== null ) { contents . outputLocation = deserializeAws_restJson1OutputLocation ( data . outputLocation , context ) ; } if ( data . robotApplications !== undefined && data . robotApplications !== null ) { contents . robotApplications = deserializeAws_restJson1RobotApplicationConfigs ( data . robotApplications , context ) ; } if ( data . simulationApplications !== undefined && data . simulationApplications !== null ) { contents . simulationApplications = deserializeAws_restJson1SimulationApplicationConfigs ( data . simulationApplications , context ) ; } if ( data . simulationTimeMillis !== undefined && data . simulationTimeMillis !== null ) { contents . simulationTimeMillis = __expectLong ( data . simulationTimeMillis ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . vpcConfig !== undefined && data . vpcConfig !== null ) { contents . vpcConfig = deserializeAws_restJson1VPCConfigResponse ( data . vpcConfig , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeSimulationJobCommandError = async ( output , context ) : Promise < DescribeSimulationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeSimulationJobBatchCommand = async ( output , context ) : Promise < DescribeSimulationJobBatchCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeSimulationJobBatchCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , batchPolicy : undefined , clientRequestToken : undefined , createdAt : undefined , createdRequests : undefined , failedRequests : undefined , failureCode : undefined , failureReason : undefined , lastUpdatedAt : undefined , pendingRequests : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . batchPolicy !== undefined && data . batchPolicy !== null ) { contents . batchPolicy = deserializeAws_restJson1BatchPolicy ( data . batchPolicy , context ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . createdRequests !== undefined && data . createdRequests !== null ) { contents . createdRequests = deserializeAws_restJson1SimulationJobSummaries ( data . createdRequests , context ) ; } if ( data . failedRequests !== undefined && data . failedRequests !== null ) { contents . failedRequests = deserializeAws_restJson1FailedCreateSimulationJobRequests ( data . failedRequests , context ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . pendingRequests !== undefined && data . pendingRequests !== null ) { contents . pendingRequests = deserializeAws_restJson1CreateSimulationJobRequests ( data . pendingRequests , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeSimulationJobBatchCommandError = async ( output , context ) : Promise < DescribeSimulationJobBatchCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( 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_restJson1DescribeWorldCommand = async ( output , context ) : Promise < DescribeWorldCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeWorldCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , generationJob : undefined , tags : undefined , template : undefined , worldDescriptionBody : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . generationJob !== undefined && data . generationJob !== null ) { contents . generationJob = __expectString ( data . generationJob ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . template !== undefined && data . template !== null ) { contents . template = __expectString ( data . template ) ; } if ( data . worldDescriptionBody !== undefined && data . worldDescriptionBody !== null ) { contents . worldDescriptionBody = __expectString ( data . worldDescriptionBody ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeWorldCommandError = async ( output , context ) : Promise < DescribeWorldCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeWorldExportJobCommand = async ( output , context ) : Promise < DescribeWorldExportJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeWorldExportJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , failureCode : undefined , failureReason : undefined , iamRole : undefined , outputLocation : undefined , status : undefined , tags : undefined , worlds : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . iamRole !== undefined && data . iamRole !== null ) { contents . iamRole = __expectString ( data . iamRole ) ; } if ( data . outputLocation !== undefined && data . outputLocation !== null ) { contents . outputLocation = deserializeAws_restJson1OutputLocation ( data . outputLocation , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . worlds !== undefined && data . worlds !== null ) { contents . worlds = deserializeAws_restJson1Arns ( data . worlds , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeWorldExportJobCommandError = async ( output , context ) : Promise < DescribeWorldExportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeWorldGenerationJobCommand = async ( output , context ) : Promise < DescribeWorldGenerationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeWorldGenerationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , failureCode : undefined , failureReason : undefined , finishedWorldsSummary : undefined , status : undefined , tags : undefined , template : undefined , worldCount : undefined , worldTags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . finishedWorldsSummary !== undefined && data . finishedWorldsSummary !== null ) { contents . finishedWorldsSummary = deserializeAws_restJson1FinishedWorldsSummary ( data . finishedWorldsSummary , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . template !== undefined && data . template !== null ) { contents . template = __expectString ( data . template ) ; } if ( data . worldCount !== undefined && data . worldCount !== null ) { contents . worldCount = deserializeAws_restJson1WorldCount ( data . worldCount , context ) ; } if ( data . worldTags !== undefined && data . worldTags !== null ) { contents . worldTags = deserializeAws_restJson1TagMap ( data . worldTags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeWorldGenerationJobCommandError = async ( output , context ) : Promise < DescribeWorldGenerationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeWorldTemplateCommand = async ( output , context ) : Promise < DescribeWorldTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeWorldTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , clientRequestToken : undefined , createdAt : undefined , lastUpdatedAt : undefined , name : undefined , tags : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeWorldTemplateCommandError = async ( output , context ) : Promise < DescribeWorldTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1GetWorldTemplateBodyCommand = async ( output , context ) : Promise < GetWorldTemplateBodyCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1GetWorldTemplateBodyCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , templateBody : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . templateBody !== undefined && data . templateBody !== null ) { contents . templateBody = __expectString ( data . templateBody ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1GetWorldTemplateBodyCommandError = async ( output , context ) : Promise < GetWorldTemplateBodyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListDeploymentJobsCommand = async ( output , context ) : Promise < ListDeploymentJobsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListDeploymentJobsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , deploymentJobs : undefined , nextToken : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . deploymentJobs !== undefined && data . deploymentJobs !== null ) { contents . deploymentJobs = deserializeAws_restJson1DeploymentJobs ( data . deploymentJobs , context ) ; } if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListDeploymentJobsCommandError = async ( output , context ) : Promise < ListDeploymentJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListFleetsCommand = async ( output , context ) : Promise < ListFleetsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListFleetsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , fleetDetails : undefined , nextToken : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . fleetDetails !== undefined && data . fleetDetails !== null ) { contents . fleetDetails = deserializeAws_restJson1Fleets ( data . fleetDetails , context ) ; } if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListFleetsCommandError = async ( output , context ) : Promise < ListFleetsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListRobotApplicationsCommand = async ( output , context ) : Promise < ListRobotApplicationsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListRobotApplicationsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , robotApplicationSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . robotApplicationSummaries !== undefined && data . robotApplicationSummaries !== null ) { contents . robotApplicationSummaries = deserializeAws_restJson1RobotApplicationSummaries ( data . robotApplicationSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListRobotApplicationsCommandError = async ( output , context ) : Promise < ListRobotApplicationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListRobotsCommand = async ( output , context ) : Promise < ListRobotsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListRobotsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , robots : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . robots !== undefined && data . robots !== null ) { contents . robots = deserializeAws_restJson1Robots ( data . robots , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListRobotsCommandError = async ( output , context ) : Promise < ListRobotsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListSimulationApplicationsCommand = async ( output , context ) : Promise < ListSimulationApplicationsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListSimulationApplicationsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , simulationApplicationSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . simulationApplicationSummaries !== undefined && data . simulationApplicationSummaries !== null ) { contents . simulationApplicationSummaries = deserializeAws_restJson1SimulationApplicationSummaries ( data . simulationApplicationSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListSimulationApplicationsCommandError = async ( output , context ) : Promise < ListSimulationApplicationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListSimulationJobBatchesCommand = async ( output , context ) : Promise < ListSimulationJobBatchesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListSimulationJobBatchesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , simulationJobBatchSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . simulationJobBatchSummaries !== undefined && data . simulationJobBatchSummaries !== null ) { contents . simulationJobBatchSummaries = deserializeAws_restJson1SimulationJobBatchSummaries ( data . simulationJobBatchSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListSimulationJobBatchesCommandError = async ( output , context ) : Promise < ListSimulationJobBatchesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( 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_restJson1ListSimulationJobsCommand = async ( output , context ) : Promise < ListSimulationJobsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListSimulationJobsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , simulationJobSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . simulationJobSummaries !== undefined && data . simulationJobSummaries !== null ) { contents . simulationJobSummaries = deserializeAws_restJson1SimulationJobSummaries ( data . simulationJobSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListSimulationJobsCommandError = async ( output , context ) : Promise < ListSimulationJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListTagsForResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListTagsForResourceCommandError = 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 "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListWorldExportJobsCommand = async ( output , context ) : Promise < ListWorldExportJobsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListWorldExportJobsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , worldExportJobSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . worldExportJobSummaries !== undefined && data . worldExportJobSummaries !== null ) { contents . worldExportJobSummaries = deserializeAws_restJson1WorldExportJobSummaries ( data . worldExportJobSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListWorldExportJobsCommandError = async ( output , context ) : Promise < ListWorldExportJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListWorldGenerationJobsCommand = async ( output , context ) : Promise < ListWorldGenerationJobsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListWorldGenerationJobsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , worldGenerationJobSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . worldGenerationJobSummaries !== undefined && data . worldGenerationJobSummaries !== null ) { contents . worldGenerationJobSummaries = deserializeAws_restJson1WorldGenerationJobSummaries ( data . worldGenerationJobSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListWorldGenerationJobsCommandError = async ( output , context ) : Promise < ListWorldGenerationJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListWorldsCommand = async ( output , context ) : Promise < ListWorldsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListWorldsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , worldSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . worldSummaries !== undefined && data . worldSummaries !== null ) { contents . worldSummaries = deserializeAws_restJson1WorldSummaries ( data . worldSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListWorldsCommandError = async ( output , context ) : Promise < ListWorldsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListWorldTemplatesCommand = async ( output , context ) : Promise < ListWorldTemplatesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListWorldTemplatesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , nextToken : undefined , templateSummaries : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . nextToken !== undefined && data . nextToken !== null ) { contents . nextToken = __expectString ( data . nextToken ) ; } if ( data . templateSummaries !== undefined && data . templateSummaries !== null ) { contents . templateSummaries = deserializeAws_restJson1TemplateSummaries ( data . templateSummaries , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListWorldTemplatesCommandError = async ( output , context ) : Promise < ListWorldTemplatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1RegisterRobotCommand = async ( output , context ) : Promise < RegisterRobotCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1RegisterRobotCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , fleet : undefined , robot : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . fleet !== undefined && data . fleet !== null ) { contents . fleet = __expectString ( data . fleet ) ; } if ( data . robot !== undefined && data . robot !== null ) { contents . robot = __expectString ( data . robot ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1RegisterRobotCommandError = async ( output , context ) : Promise < RegisterRobotCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1RestartSimulationJobCommand = async ( output , context ) : Promise < RestartSimulationJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1RestartSimulationJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1RestartSimulationJobCommandError = async ( output , context ) : Promise < RestartSimulationJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1StartSimulationJobBatchCommand = async ( output , context ) : Promise < StartSimulationJobBatchCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1StartSimulationJobBatchCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , batchPolicy : undefined , clientRequestToken : undefined , createdAt : undefined , createdRequests : undefined , failedRequests : undefined , failureCode : undefined , failureReason : undefined , pendingRequests : undefined , status : undefined , tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . batchPolicy !== undefined && data . batchPolicy !== null ) { contents . batchPolicy = deserializeAws_restJson1BatchPolicy ( data . batchPolicy , context ) ; } if ( data . clientRequestToken !== undefined && data . clientRequestToken !== null ) { contents . clientRequestToken = __expectString ( data . clientRequestToken ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . createdRequests !== undefined && data . createdRequests !== null ) { contents . createdRequests = deserializeAws_restJson1SimulationJobSummaries ( data . createdRequests , context ) ; } if ( data . failedRequests !== undefined && data . failedRequests !== null ) { contents . failedRequests = deserializeAws_restJson1FailedCreateSimulationJobRequests ( data . failedRequests , context ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . pendingRequests !== undefined && data . pendingRequests !== null ) { contents . pendingRequests = deserializeAws_restJson1CreateSimulationJobRequests ( data . pendingRequests , context ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } if ( data . tags !== undefined && data . tags !== null ) { contents . tags = deserializeAws_restJson1TagMap ( data . tags , context ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1StartSimulationJobBatchCommandError = async ( output , context ) : Promise < StartSimulationJobBatchCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1SyncDeploymentJobCommand = async ( output , context ) : Promise < SyncDeploymentJobCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1SyncDeploymentJobCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , deploymentApplicationConfigs : undefined , deploymentConfig : undefined , failureCode : undefined , failureReason : undefined , fleet : undefined , status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . deploymentApplicationConfigs !== undefined && data . deploymentApplicationConfigs !== null ) { contents . deploymentApplicationConfigs = deserializeAws_restJson1DeploymentApplicationConfigs ( data . deploymentApplicationConfigs , context ) ; } if ( data . deploymentConfig !== undefined && data . deploymentConfig !== null ) { contents . deploymentConfig = deserializeAws_restJson1DeploymentConfig ( data . deploymentConfig , context ) ; } if ( data . failureCode !== undefined && data . failureCode !== null ) { contents . failureCode = __expectString ( data . failureCode ) ; } if ( data . failureReason !== undefined && data . failureReason !== null ) { contents . failureReason = __expectString ( data . failureReason ) ; } if ( data . fleet !== undefined && data . fleet !== null ) { contents . fleet = __expectString ( data . fleet ) ; } if ( data . status !== undefined && data . status !== null ) { contents . status = __expectString ( data . status ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1SyncDeploymentJobCommandError = async ( output , context ) : Promise < SyncDeploymentJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConcurrentDeploymentException" : case "com.amazonaws.robomaker#ConcurrentDeploymentException" : response = { ... ( await deserializeAws_restJson1ConcurrentDeploymentExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IdempotentParameterMismatchException" : case "com.amazonaws.robomaker#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1TagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1TagResourceCommandError = 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 "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UntagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , } ; await collectBody ( output . body , context ) ; return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UntagResourceCommandError = 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 "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateRobotApplicationCommand = async ( output , context ) : Promise < UpdateRobotApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateRobotApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , revisionId : undefined , robotSoftwareSuite : undefined , sources : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateRobotApplicationCommandError = async ( output , context ) : Promise < UpdateRobotApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateSimulationApplicationCommand = async ( output , context ) : Promise < UpdateSimulationApplicationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateSimulationApplicationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , environment : undefined , lastUpdatedAt : undefined , name : undefined , renderingEngine : undefined , revisionId : undefined , robotSoftwareSuite : undefined , simulationSoftwareSuite : undefined , sources : undefined , version : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . environment !== undefined && data . environment !== null ) { contents . environment = deserializeAws_restJson1Environment ( data . environment , context ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } if ( data . renderingEngine !== undefined && data . renderingEngine !== null ) { contents . renderingEngine = deserializeAws_restJson1RenderingEngine ( data . renderingEngine , context ) ; } if ( data . revisionId !== undefined && data . revisionId !== null ) { contents . revisionId = __expectString ( data . revisionId ) ; } if ( data . robotSoftwareSuite !== undefined && data . robotSoftwareSuite !== null ) { contents . robotSoftwareSuite = deserializeAws_restJson1RobotSoftwareSuite ( data . robotSoftwareSuite , context ) ; } if ( data . simulationSoftwareSuite !== undefined && data . simulationSoftwareSuite !== null ) { contents . simulationSoftwareSuite = deserializeAws_restJson1SimulationSoftwareSuite ( data . simulationSoftwareSuite , context ) ; } if ( data . sources !== undefined && data . sources !== null ) { contents . sources = deserializeAws_restJson1Sources ( data . sources , context ) ; } if ( data . version !== undefined && data . version !== null ) { contents . version = __expectString ( data . version ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateSimulationApplicationCommandError = async ( output , context ) : Promise < UpdateSimulationApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.robomaker#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateWorldTemplateCommand = async ( output , context ) : Promise < UpdateWorldTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateWorldTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , arn : undefined , createdAt : undefined , lastUpdatedAt : undefined , name : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . arn !== undefined && data . arn !== null ) { contents . arn = __expectString ( data . arn ) ; } if ( data . createdAt !== undefined && data . createdAt !== null ) { contents . createdAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . createdAt ) ) ) ; } if ( data . lastUpdatedAt !== undefined && data . lastUpdatedAt !== null ) { contents . lastUpdatedAt = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . lastUpdatedAt ) ) ) ; } if ( data . name !== undefined && data . name !== null ) { contents . name = __expectString ( data . name ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateWorldTemplateCommandError = async ( output , context ) : Promise < UpdateWorldTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServerException" : case "com.amazonaws.robomaker#InternalServerException" : response = { ... ( await deserializeAws_restJson1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.robomaker#InvalidParameterException" : response = { ... ( await deserializeAws_restJson1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.robomaker#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.robomaker#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ConcurrentDeploymentExceptionResponse = async ( parsedOutput , context ) : Promise < ConcurrentDeploymentException > => { const contents = { name : "ConcurrentDeploymentException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1IdempotentParameterMismatchExceptionResponse = async ( parsedOutput , context ) : Promise < IdempotentParameterMismatchException > => { const contents = { name : "IdempotentParameterMismatchException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1InternalServerExceptionResponse = async ( parsedOutput , context ) : Promise < InternalServerException > => { const contents = { name : "InternalServerException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1InvalidParameterExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterException > => { const contents = { name : "InvalidParameterException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1ResourceAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceAlreadyExistsException > => { const contents = { name : "ResourceAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1ServiceUnavailableExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceUnavailableException > => { const contents = { name : "ServiceUnavailableException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const deserializeAws_restJson1ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const contents = { name : "ThrottlingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , message : undefined , } ; const data = parsedOutput . body ; if ( data . message !== undefined && data . message !== null ) { contents . message = __expectString ( data . message ) ; } return contents ; } ; const serializeAws_restJson1Arns = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1BatchPolicy = ( input , context ) : any => { return { ... ( input . maxConcurrency !== undefined && input . maxConcurrency !== null && { maxConcurrency : input . maxConcurrency } ) , ... ( input . timeoutInSeconds !== undefined && input . timeoutInSeconds !== null && { timeoutInSeconds : input . timeoutInSeconds } ) , } ; } ; const serializeAws_restJson1CommandList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1Compute = ( input , context ) : any => { return { ... ( input . computeType !== undefined && input . computeType !== null && { computeType : input . computeType } ) , ... ( input . gpuUnitLimit !== undefined && input . gpuUnitLimit !== null && { gpuUnitLimit : input . gpuUnitLimit } ) , ... ( input . simulationUnitLimit !== undefined && input . simulationUnitLimit !== null && { simulationUnitLimit : input . simulationUnitLimit } ) , } ; } ; const serializeAws_restJson1CreateSimulationJobRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1SimulationJobRequest ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DataSourceConfig = ( input , context ) : any => { return { ... ( input . destination !== undefined && input . destination !== null && { destination : input . destination } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . s3Bucket !== undefined && input . s3Bucket !== null && { s3Bucket : input . s3Bucket } ) , ... ( input . s3Keys !== undefined && input . s3Keys !== null && { s3Keys : serializeAws_restJson1S3KeysOrPrefixes ( input . s3Keys , context ) } ) , ... ( input . type !== undefined && input . type !== null && { type : input . type } ) , } ; } ; const serializeAws_restJson1DataSourceConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DataSourceConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DeploymentApplicationConfig = ( input , context ) : any => { return { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , ... ( input . launchConfig !== undefined && input . launchConfig !== null && { launchConfig : serializeAws_restJson1DeploymentLaunchConfig ( input . launchConfig , context ) , } ) , } ; } ; const serializeAws_restJson1DeploymentApplicationConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DeploymentApplicationConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DeploymentConfig = ( input , context ) : any => { return { ... ( input . concurrentDeploymentPercentage !== undefined && input . concurrentDeploymentPercentage !== null && { concurrentDeploymentPercentage : input . concurrentDeploymentPercentage , } ) , ... ( input . downloadConditionFile !== undefined && input . downloadConditionFile !== null && { downloadConditionFile : serializeAws_restJson1S3Object ( input . downloadConditionFile , context ) , } ) , ... ( input . failureThresholdPercentage !== undefined && input . failureThresholdPercentage !== null && { failureThresholdPercentage : input . failureThresholdPercentage } ) , ... ( input . robotDeploymentTimeoutInSeconds !== undefined && input . robotDeploymentTimeoutInSeconds !== null && { robotDeploymentTimeoutInSeconds : input . robotDeploymentTimeoutInSeconds , } ) , } ; } ; const serializeAws_restJson1DeploymentLaunchConfig = ( input , context ) : any => { return { ... ( input . environmentVariables !== undefined && input . environmentVariables !== null && { environmentVariables : serializeAws_restJson1EnvironmentVariableMap ( input . environmentVariables , context ) , } ) , ... ( input . launchFile !== undefined && input . launchFile !== null && { launchFile : input . launchFile } ) , ... ( input . packageName !== undefined && input . packageName !== null && { packageName : input . packageName } ) , ... ( input . postLaunchFile !== undefined && input . postLaunchFile !== null && { postLaunchFile : input . postLaunchFile } ) , ... ( input . preLaunchFile !== undefined && input . preLaunchFile !== null && { preLaunchFile : input . preLaunchFile } ) , } ; } ; const serializeAws_restJson1Environment = ( input , context ) : any => { return { ... ( input . uri !== undefined && input . uri !== null && { uri : input . uri } ) , } ; } ; const serializeAws_restJson1EnvironmentVariableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_restJson1Filter = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . values !== undefined && input . values !== null && { values : serializeAws_restJson1FilterValues ( input . values , context ) } ) , } ; } ; const serializeAws_restJson1Filters = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1Filter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1FilterValues = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1LaunchConfig = ( input , context ) : any => { return { ... ( input . command !== undefined && input . command !== null && { command : serializeAws_restJson1CommandList ( input . command , context ) } ) , ... ( input . environmentVariables !== undefined && input . environmentVariables !== null && { environmentVariables : serializeAws_restJson1EnvironmentVariableMap ( input . environmentVariables , context ) , } ) , ... ( input . launchFile !== undefined && input . launchFile !== null && { launchFile : input . launchFile } ) , ... ( input . packageName !== undefined && input . packageName !== null && { packageName : input . packageName } ) , ... ( input . portForwardingConfig !== undefined && input . portForwardingConfig !== null && { portForwardingConfig : serializeAws_restJson1PortForwardingConfig ( input . portForwardingConfig , context ) , } ) , ... ( input . streamUI !== undefined && input . streamUI !== null && { streamUI : input . streamUI } ) , } ; } ; const serializeAws_restJson1LoggingConfig = ( input , context ) : any => { return { ... ( input . recordAllRosTopics !== undefined && input . recordAllRosTopics !== null && { recordAllRosTopics : input . recordAllRosTopics } ) , } ; } ; const serializeAws_restJson1OutputLocation = ( input , context ) : any => { return { ... ( input . s3Bucket !== undefined && input . s3Bucket !== null && { s3Bucket : input . s3Bucket } ) , ... ( input . s3Prefix !== undefined && input . s3Prefix !== null && { s3Prefix : input . s3Prefix } ) , } ; } ; const serializeAws_restJson1PortForwardingConfig = ( input , context ) : any => { return { ... ( input . portMappings !== undefined && input . portMappings !== null && { portMappings : serializeAws_restJson1PortMappingList ( input . portMappings , context ) , } ) , } ; } ; const serializeAws_restJson1PortMapping = ( input , context ) : any => { return { ... ( input . applicationPort !== undefined && input . applicationPort !== null && { applicationPort : input . applicationPort } ) , ... ( input . enableOnPublicIp !== undefined && input . enableOnPublicIp !== null && { enableOnPublicIp : input . enableOnPublicIp } ) , ... ( input . jobPort !== undefined && input . jobPort !== null && { jobPort : input . jobPort } ) , } ; } ; const serializeAws_restJson1PortMappingList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1PortMapping ( entry , context ) ; } ) ; } ; const serializeAws_restJson1RenderingEngine = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . version !== undefined && input . version !== null && { version : input . version } ) , } ; } ; const serializeAws_restJson1RobotApplicationConfig = ( input , context ) : any => { return { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , ... ( input . launchConfig !== undefined && input . launchConfig !== null && { launchConfig : serializeAws_restJson1LaunchConfig ( input . launchConfig , context ) } ) , ... ( input . tools !== undefined && input . tools !== null && { tools : serializeAws_restJson1Tools ( input . tools , context ) } ) , ... ( input . uploadConfigurations !== undefined && input . uploadConfigurations !== null && { uploadConfigurations : serializeAws_restJson1UploadConfigurations ( input . uploadConfigurations , context ) , } ) , ... ( input . useDefaultTools !== undefined && input . useDefaultTools !== null && { useDefaultTools : input . useDefaultTools } ) , ... ( input . useDefaultUploadConfigurations !== undefined && input . useDefaultUploadConfigurations !== null && { useDefaultUploadConfigurations : input . useDefaultUploadConfigurations , } ) , } ; } ; const serializeAws_restJson1RobotApplicationConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1RobotApplicationConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1RobotSoftwareSuite = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . version !== undefined && input . version !== null && { version : input . version } ) , } ; } ; const serializeAws_restJson1S3Etags = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1S3KeysOrPrefixes = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1S3Object = ( input , context ) : any => { return { ... ( input . bucket !== undefined && input . bucket !== null && { bucket : input . bucket } ) , ... ( input . etag !== undefined && input . etag !== null && { etag : input . etag } ) , ... ( input . key !== undefined && input . key !== null && { key : input . key } ) , } ; } ; const serializeAws_restJson1SecurityGroups = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1SimulationApplicationConfig = ( input , context ) : any => { return { ... ( input . application !== undefined && input . application !== null && { application : input . application } ) , ... ( input . applicationVersion !== undefined && input . applicationVersion !== null && { applicationVersion : input . applicationVersion } ) , ... ( input . launchConfig !== undefined && input . launchConfig !== null && { launchConfig : serializeAws_restJson1LaunchConfig ( input . launchConfig , context ) } ) , ... ( input . tools !== undefined && input . tools !== null && { tools : serializeAws_restJson1Tools ( input . tools , context ) } ) , ... ( input . uploadConfigurations !== undefined && input . uploadConfigurations !== null && { uploadConfigurations : serializeAws_restJson1UploadConfigurations ( input . uploadConfigurations , context ) , } ) , ... ( input . useDefaultTools !== undefined && input . useDefaultTools !== null && { useDefaultTools : input . useDefaultTools } ) , ... ( input . useDefaultUploadConfigurations !== undefined && input . useDefaultUploadConfigurations !== null && { useDefaultUploadConfigurations : input . useDefaultUploadConfigurations , } ) , ... ( input . worldConfigs !== undefined && input . worldConfigs !== null && { worldConfigs : serializeAws_restJson1WorldConfigs ( input . worldConfigs , context ) } ) , } ; } ; const serializeAws_restJson1SimulationApplicationConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1SimulationApplicationConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1SimulationJobRequest = ( input , context ) : any => { return { ... ( input . compute !== undefined && input . compute !== null && { compute : serializeAws_restJson1Compute ( input . compute , context ) } ) , ... ( input . dataSources !== undefined && input . dataSources !== null && { dataSources : serializeAws_restJson1DataSourceConfigs ( input . dataSources , context ) , } ) , ... ( input . failureBehavior !== undefined && input . failureBehavior !== null && { failureBehavior : input . failureBehavior } ) , ... ( input . iamRole !== undefined && input . iamRole !== null && { iamRole : input . iamRole } ) , ... ( input . loggingConfig !== undefined && input . loggingConfig !== null && { loggingConfig : serializeAws_restJson1LoggingConfig ( input . loggingConfig , context ) , } ) , ... ( input . maxJobDurationInSeconds !== undefined && input . maxJobDurationInSeconds !== null && { maxJobDurationInSeconds : input . maxJobDurationInSeconds } ) , ... ( input . outputLocation !== undefined && input . outputLocation !== null && { outputLocation : serializeAws_restJson1OutputLocation ( input . outputLocation , context ) , } ) , ... ( input . robotApplications !== undefined && input . robotApplications !== null && { robotApplications : serializeAws_restJson1RobotApplicationConfigs ( input . robotApplications , context ) , } ) , ... ( input . simulationApplications !== undefined && input . simulationApplications !== null && { simulationApplications : serializeAws_restJson1SimulationApplicationConfigs ( input . simulationApplications , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_restJson1TagMap ( input . tags , context ) } ) , ... ( input . useDefaultApplications !== undefined && input . useDefaultApplications !== null && { useDefaultApplications : input . useDefaultApplications } ) , ... ( input . vpcConfig !== undefined && input . vpcConfig !== null && { vpcConfig : serializeAws_restJson1VPCConfig ( input . vpcConfig , context ) } ) , } ; } ; const serializeAws_restJson1SimulationSoftwareSuite = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . version !== undefined && input . version !== null && { version : input . version } ) , } ; } ; const serializeAws_restJson1SourceConfig = ( input , context ) : any => { return { ... ( input . architecture !== undefined && input . architecture !== null && { architecture : input . architecture } ) , ... ( input . s3Bucket !== undefined && input . s3Bucket !== null && { s3Bucket : input . s3Bucket } ) , ... ( input . s3Key !== undefined && input . s3Key !== null && { s3Key : input . s3Key } ) , } ; } ; const serializeAws_restJson1SourceConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1SourceConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1Subnets = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1TagMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_restJson1TemplateLocation = ( input , context ) : any => { return { ... ( input . s3Bucket !== undefined && input . s3Bucket !== null && { s3Bucket : input . s3Bucket } ) , ... ( input . s3Key !== undefined && input . s3Key !== null && { s3Key : input . s3Key } ) , } ; } ; const serializeAws_restJson1Tool = ( input , context ) : any => { return { ... ( input . command !== undefined && input . command !== null && { command : input . command } ) , ... ( input . exitBehavior !== undefined && input . exitBehavior !== null && { exitBehavior : input . exitBehavior } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . streamOutputToCloudWatch !== undefined && input . streamOutputToCloudWatch !== null && { streamOutputToCloudWatch : input . streamOutputToCloudWatch } ) , ... ( input . streamUI !== undefined && input . streamUI !== null && { streamUI : input . streamUI } ) , } ; } ; const serializeAws_restJson1Tools = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1Tool ( entry , context ) ; } ) ; } ; const serializeAws_restJson1UploadConfiguration = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . path !== undefined && input . path !== null && { path : input . path } ) , ... ( input . uploadBehavior !== undefined && input . uploadBehavior !== null && { uploadBehavior : input . uploadBehavior } ) , } ; } ; const serializeAws_restJson1UploadConfigurations = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1UploadConfiguration ( entry , context ) ; } ) ; } ; const serializeAws_restJson1VPCConfig = ( input , context ) : any => { return { ... ( input . assignPublicIp !== undefined && input . assignPublicIp !== null && { assignPublicIp : input . assignPublicIp } ) , ... ( input . securityGroups !== undefined && input . securityGroups !== null && { securityGroups : serializeAws_restJson1SecurityGroups ( input . securityGroups , context ) , } ) , ... ( input . subnets !== undefined && input . subnets !== null && { subnets : serializeAws_restJson1Subnets ( input . subnets , context ) } ) , } ; } ; const serializeAws_restJson1WorldConfig = ( input , context ) : any => { return { ... ( input . world !== undefined && input . world !== null && { world : input . world } ) , } ; } ; const serializeAws_restJson1WorldConfigs = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1WorldConfig ( entry , context ) ; } ) ; } ; const serializeAws_restJson1WorldCount = ( input , context ) : any => { return { ... ( input . floorplanCount !== undefined && input . floorplanCount !== null && { floorplanCount : input . floorplanCount } ) , ... ( input . interiorCountPerFloorplan !== undefined && input . interiorCountPerFloorplan !== null && { interiorCountPerFloorplan : input . interiorCountPerFloorplan } ) , } ; } ; const deserializeAws_restJson1Arns = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1BatchPolicy = ( output , context ) : BatchPolicy => { return { maxConcurrency : __expectInt32 ( output . maxConcurrency ) , timeoutInSeconds : __expectLong ( output . timeoutInSeconds ) , } as any ; } ; const deserializeAws_restJson1CommandList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1Compute = ( output , context ) : Compute => { return { computeType : __expectString ( output . computeType ) , gpuUnitLimit : __expectInt32 ( output . gpuUnitLimit ) , simulationUnitLimit : __expectInt32 ( output . simulationUnitLimit ) , } as any ; } ; const deserializeAws_restJson1ComputeResponse = ( output , context ) : ComputeResponse => { return { computeType : __expectString ( output . computeType ) , gpuUnitLimit : __expectInt32 ( output . gpuUnitLimit ) , simulationUnitLimit : __expectInt32 ( output . simulationUnitLimit ) , } as any ; } ; const deserializeAws_restJson1CreateSimulationJobRequests = ( output , context ) : SimulationJobRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationJobRequest ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataSource = ( output , context ) : DataSource => { return { destination : __expectString ( output . destination ) , name : __expectString ( output . name ) , s3Bucket : __expectString ( output . s3Bucket ) , s3Keys : output . s3Keys !== undefined && output . s3Keys !== null ? deserializeAws_restJson1S3KeyOutputs ( output . s3Keys , context ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_restJson1DataSourceConfig = ( output , context ) : DataSourceConfig => { return { destination : __expectString ( output . destination ) , name : __expectString ( output . name ) , s3Bucket : __expectString ( output . s3Bucket ) , s3Keys : output . s3Keys !== undefined && output . s3Keys !== null ? deserializeAws_restJson1S3KeysOrPrefixes ( output . s3Keys , context ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_restJson1DataSourceConfigs = ( output , context ) : DataSourceConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSourceConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataSourceNames = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1DataSources = ( output , context ) : DataSource [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSource ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DeploymentApplicationConfig = ( output , context ) : DeploymentApplicationConfig => { return { application : __expectString ( output . application ) , applicationVersion : __expectString ( output . applicationVersion ) , launchConfig : output . launchConfig !== undefined && output . launchConfig !== null ? deserializeAws_restJson1DeploymentLaunchConfig ( output . launchConfig , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DeploymentApplicationConfigs = ( output , context ) : DeploymentApplicationConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DeploymentApplicationConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DeploymentConfig = ( output , context ) : DeploymentConfig => { return { concurrentDeploymentPercentage : __expectInt32 ( output . concurrentDeploymentPercentage ) , downloadConditionFile : output . downloadConditionFile !== undefined && output . downloadConditionFile !== null ? deserializeAws_restJson1S3Object ( output . downloadConditionFile , context ) : undefined , failureThresholdPercentage : __expectInt32 ( output . failureThresholdPercentage ) , robotDeploymentTimeoutInSeconds : __expectLong ( output . robotDeploymentTimeoutInSeconds ) , } as any ; } ; const deserializeAws_restJson1DeploymentJob = ( output , context ) : DeploymentJob => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentApplicationConfigs : output . deploymentApplicationConfigs !== undefined && output . deploymentApplicationConfigs !== null ? deserializeAws_restJson1DeploymentApplicationConfigs ( output . deploymentApplicationConfigs , context ) : undefined , deploymentConfig : output . deploymentConfig !== undefined && output . deploymentConfig !== null ? deserializeAws_restJson1DeploymentConfig ( output . deploymentConfig , context ) : undefined , failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , fleet : __expectString ( output . fleet ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_restJson1DeploymentJobs = ( output , context ) : DeploymentJob [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DeploymentJob ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DeploymentLaunchConfig = ( output , context ) : DeploymentLaunchConfig => { return { environmentVariables : output . environmentVariables !== undefined && output . environmentVariables !== null ? deserializeAws_restJson1EnvironmentVariableMap ( output . environmentVariables , context ) : undefined , launchFile : __expectString ( output . launchFile ) , packageName : __expectString ( output . packageName ) , postLaunchFile : __expectString ( output . postLaunchFile ) , preLaunchFile : __expectString ( output . preLaunchFile ) , } as any ; } ; const deserializeAws_restJson1Environment = ( output , context ) : Environment => { return { uri : __expectString ( output . uri ) , } as any ; } ; const deserializeAws_restJson1EnvironmentVariableMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_restJson1FailedCreateSimulationJobRequest = ( output , context ) : FailedCreateSimulationJobRequest => { return { failedAt : output . failedAt !== undefined && output . failedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . failedAt ) ) ) : undefined , failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , request : output . request !== undefined && output . request !== null ? deserializeAws_restJson1SimulationJobRequest ( output . request , context ) : undefined , } as any ; } ; const deserializeAws_restJson1FailedCreateSimulationJobRequests = ( output , context ) : FailedCreateSimulationJobRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1FailedCreateSimulationJobRequest ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1FailureSummary = ( output , context ) : FailureSummary => { return { failures : output . failures !== undefined && output . failures !== null ? deserializeAws_restJson1WorldFailures ( output . failures , context ) : undefined , totalFailureCount : __expectInt32 ( output . totalFailureCount ) , } as any ; } ; const deserializeAws_restJson1FinishedWorldsSummary = ( output , context ) : FinishedWorldsSummary => { return { failureSummary : output . failureSummary !== undefined && output . failureSummary !== null ? deserializeAws_restJson1FailureSummary ( output . failureSummary , context ) : undefined , finishedCount : __expectInt32 ( output . finishedCount ) , succeededWorlds : output . succeededWorlds !== undefined && output . succeededWorlds !== null ? deserializeAws_restJson1Arns ( output . succeededWorlds , context ) : undefined , } as any ; } ; const deserializeAws_restJson1Fleet = ( output , context ) : Fleet => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , lastDeploymentJob : __expectString ( output . lastDeploymentJob ) , lastDeploymentStatus : __expectString ( output . lastDeploymentStatus ) , lastDeploymentTime : output . lastDeploymentTime !== undefined && output . lastDeploymentTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentTime ) ) ) : undefined , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_restJson1Fleets = ( output , context ) : Fleet [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Fleet ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1LaunchConfig = ( output , context ) : LaunchConfig => { return { command : output . command !== undefined && output . command !== null ? deserializeAws_restJson1CommandList ( output . command , context ) : undefined , environmentVariables : output . environmentVariables !== undefined && output . environmentVariables !== null ? deserializeAws_restJson1EnvironmentVariableMap ( output . environmentVariables , context ) : undefined , launchFile : __expectString ( output . launchFile ) , packageName : __expectString ( output . packageName ) , portForwardingConfig : output . portForwardingConfig !== undefined && output . portForwardingConfig !== null ? deserializeAws_restJson1PortForwardingConfig ( output . portForwardingConfig , context ) : undefined , streamUI : __expectBoolean ( output . streamUI ) , } as any ; } ; const deserializeAws_restJson1LoggingConfig = ( output , context ) : LoggingConfig => { return { recordAllRosTopics : __expectBoolean ( output . recordAllRosTopics ) , } as any ; } ; const deserializeAws_restJson1NetworkInterface = ( output , context ) : NetworkInterface => { return { networkInterfaceId : __expectString ( output . networkInterfaceId ) , privateIpAddress : __expectString ( output . privateIpAddress ) , publicIpAddress : __expectString ( output . publicIpAddress ) , } as any ; } ; const deserializeAws_restJson1OutputLocation = ( output , context ) : OutputLocation => { return { s3Bucket : __expectString ( output . s3Bucket ) , s3Prefix : __expectString ( output . s3Prefix ) , } as any ; } ; const deserializeAws_restJson1PortForwardingConfig = ( output , context ) : PortForwardingConfig => { return { portMappings : output . portMappings !== undefined && output . portMappings !== null ? deserializeAws_restJson1PortMappingList ( output . portMappings , context ) : undefined , } as any ; } ; const deserializeAws_restJson1PortMapping = ( output , context ) : PortMapping => { return { applicationPort : __expectInt32 ( output . applicationPort ) , enableOnPublicIp : __expectBoolean ( output . enableOnPublicIp ) , jobPort : __expectInt32 ( output . jobPort ) , } as any ; } ; const deserializeAws_restJson1PortMappingList = ( output , context ) : PortMapping [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1PortMapping ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ProgressDetail = ( output , context ) : ProgressDetail => { return { currentProgress : __expectString ( output . currentProgress ) , estimatedTimeRemainingSeconds : __expectInt32 ( output . estimatedTimeRemainingSeconds ) , percentDone : __limitedParseFloat32 ( output . percentDone ) , targetResource : __expectString ( output . targetResource ) , } as any ; } ; const deserializeAws_restJson1RenderingEngine = ( output , context ) : RenderingEngine => { return { name : __expectString ( output . name ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1Robot = ( output , context ) : Robot => { return { architecture : __expectString ( output . architecture ) , arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , fleetArn : __expectString ( output . fleetArn ) , greenGrassGroupId : __expectString ( output . greenGrassGroupId ) , lastDeploymentJob : __expectString ( output . lastDeploymentJob ) , lastDeploymentTime : output . lastDeploymentTime !== undefined && output . lastDeploymentTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentTime ) ) ) : undefined , name : __expectString ( output . name ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_restJson1RobotApplicationConfig = ( output , context ) : RobotApplicationConfig => { return { application : __expectString ( output . application ) , applicationVersion : __expectString ( output . applicationVersion ) , launchConfig : output . launchConfig !== undefined && output . launchConfig !== null ? deserializeAws_restJson1LaunchConfig ( output . launchConfig , context ) : undefined , tools : output . tools !== undefined && output . tools !== null ? deserializeAws_restJson1Tools ( output . tools , context ) : undefined , uploadConfigurations : output . uploadConfigurations !== undefined && output . uploadConfigurations !== null ? deserializeAws_restJson1UploadConfigurations ( output . uploadConfigurations , context ) : undefined , useDefaultTools : __expectBoolean ( output . useDefaultTools ) , useDefaultUploadConfigurations : __expectBoolean ( output . useDefaultUploadConfigurations ) , } as any ; } ; const deserializeAws_restJson1RobotApplicationConfigs = ( output , context ) : RobotApplicationConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1RobotApplicationConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1RobotApplicationNames = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1RobotApplicationSummaries = ( output , context ) : RobotApplicationSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1RobotApplicationSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1RobotApplicationSummary = ( output , context ) : RobotApplicationSummary => { return { arn : __expectString ( output . arn ) , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , name : __expectString ( output . name ) , robotSoftwareSuite : output . robotSoftwareSuite !== undefined && output . robotSoftwareSuite !== null ? deserializeAws_restJson1RobotSoftwareSuite ( output . robotSoftwareSuite , context ) : undefined , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1RobotDeployment = ( output , context ) : RobotDeployment => { return { arn : __expectString ( output . arn ) , deploymentFinishTime : output . deploymentFinishTime !== undefined && output . deploymentFinishTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . deploymentFinishTime ) ) ) : undefined , deploymentStartTime : output . deploymentStartTime !== undefined && output . deploymentStartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . deploymentStartTime ) ) ) : undefined , failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , progressDetail : output . progressDetail !== undefined && output . progressDetail !== null ? deserializeAws_restJson1ProgressDetail ( output . progressDetail , context ) : undefined , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_restJson1RobotDeploymentSummary = ( output , context ) : RobotDeployment [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1RobotDeployment ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1Robots = ( output , context ) : Robot [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Robot ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1RobotSoftwareSuite = ( output , context ) : RobotSoftwareSuite => { return { name : __expectString ( output . name ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1S3KeyOutput = ( output , context ) : S3KeyOutput => { return { etag : __expectString ( output . etag ) , s3Key : __expectString ( output . s3Key ) , } as any ; } ; const deserializeAws_restJson1S3KeyOutputs = ( output , context ) : S3KeyOutput [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1S3KeyOutput ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1S3KeysOrPrefixes = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1S3Object = ( output , context ) : S3Object => { return { bucket : __expectString ( output . bucket ) , etag : __expectString ( output . etag ) , key : __expectString ( output . key ) , } as any ; } ; const deserializeAws_restJson1SecurityGroups = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1SimulationApplicationConfig = ( output , context ) : SimulationApplicationConfig => { return { application : __expectString ( output . application ) , applicationVersion : __expectString ( output . applicationVersion ) , launchConfig : output . launchConfig !== undefined && output . launchConfig !== null ? deserializeAws_restJson1LaunchConfig ( output . launchConfig , context ) : undefined , tools : output . tools !== undefined && output . tools !== null ? deserializeAws_restJson1Tools ( output . tools , context ) : undefined , uploadConfigurations : output . uploadConfigurations !== undefined && output . uploadConfigurations !== null ? deserializeAws_restJson1UploadConfigurations ( output . uploadConfigurations , context ) : undefined , useDefaultTools : __expectBoolean ( output . useDefaultTools ) , useDefaultUploadConfigurations : __expectBoolean ( output . useDefaultUploadConfigurations ) , worldConfigs : output . worldConfigs !== undefined && output . worldConfigs !== null ? deserializeAws_restJson1WorldConfigs ( output . worldConfigs , context ) : undefined , } as any ; } ; const deserializeAws_restJson1SimulationApplicationConfigs = ( output , context ) : SimulationApplicationConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationApplicationConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SimulationApplicationNames = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1SimulationApplicationSummaries = ( output , context ) : SimulationApplicationSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationApplicationSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SimulationApplicationSummary = ( output , context ) : SimulationApplicationSummary => { return { arn : __expectString ( output . arn ) , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , name : __expectString ( output . name ) , robotSoftwareSuite : output . robotSoftwareSuite !== undefined && output . robotSoftwareSuite !== null ? deserializeAws_restJson1RobotSoftwareSuite ( output . robotSoftwareSuite , context ) : undefined , simulationSoftwareSuite : output . simulationSoftwareSuite !== undefined && output . simulationSoftwareSuite !== null ? deserializeAws_restJson1SimulationSoftwareSuite ( output . simulationSoftwareSuite , context ) : undefined , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1SimulationJob = ( output , context ) : SimulationJob => { return { arn : __expectString ( output . arn ) , clientRequestToken : __expectString ( output . clientRequestToken ) , compute : output . compute !== undefined && output . compute !== null ? deserializeAws_restJson1ComputeResponse ( output . compute , context ) : undefined , dataSources : output . dataSources !== undefined && output . dataSources !== null ? deserializeAws_restJson1DataSources ( output . dataSources , context ) : undefined , failureBehavior : __expectString ( output . failureBehavior ) , failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , iamRole : __expectString ( output . iamRole ) , lastStartedAt : output . lastStartedAt !== undefined && output . lastStartedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastStartedAt ) ) ) : undefined , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , loggingConfig : output . loggingConfig !== undefined && output . loggingConfig !== null ? deserializeAws_restJson1LoggingConfig ( output . loggingConfig , context ) : undefined , maxJobDurationInSeconds : __expectLong ( output . maxJobDurationInSeconds ) , name : __expectString ( output . name ) , networkInterface : output . networkInterface !== undefined && output . networkInterface !== null ? deserializeAws_restJson1NetworkInterface ( output . networkInterface , context ) : undefined , outputLocation : output . outputLocation !== undefined && output . outputLocation !== null ? deserializeAws_restJson1OutputLocation ( output . outputLocation , context ) : undefined , robotApplications : output . robotApplications !== undefined && output . robotApplications !== null ? deserializeAws_restJson1RobotApplicationConfigs ( output . robotApplications , context ) : undefined , simulationApplications : output . simulationApplications !== undefined && output . simulationApplications !== null ? deserializeAws_restJson1SimulationApplicationConfigs ( output . simulationApplications , context ) : undefined , simulationTimeMillis : __expectLong ( output . simulationTimeMillis ) , status : __expectString ( output . status ) , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_restJson1TagMap ( output . tags , context ) : undefined , vpcConfig : output . vpcConfig !== undefined && output . vpcConfig !== null ? deserializeAws_restJson1VPCConfigResponse ( output . vpcConfig , context ) : undefined , } as any ; } ; const deserializeAws_restJson1SimulationJobBatchSummaries = ( output , context ) : SimulationJobBatchSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationJobBatchSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SimulationJobBatchSummary = ( output , context ) : SimulationJobBatchSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , createdRequestCount : __expectInt32 ( output . createdRequestCount ) , failedRequestCount : __expectInt32 ( output . failedRequestCount ) , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , pendingRequestCount : __expectInt32 ( output . pendingRequestCount ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_restJson1SimulationJobRequest = ( output , context ) : SimulationJobRequest => { return { compute : output . compute !== undefined && output . compute !== null ? deserializeAws_restJson1Compute ( output . compute , context ) : undefined , dataSources : output . dataSources !== undefined && output . dataSources !== null ? deserializeAws_restJson1DataSourceConfigs ( output . dataSources , context ) : undefined , failureBehavior : __expectString ( output . failureBehavior ) , iamRole : __expectString ( output . iamRole ) , loggingConfig : output . loggingConfig !== undefined && output . loggingConfig !== null ? deserializeAws_restJson1LoggingConfig ( output . loggingConfig , context ) : undefined , maxJobDurationInSeconds : __expectLong ( output . maxJobDurationInSeconds ) , outputLocation : output . outputLocation !== undefined && output . outputLocation !== null ? deserializeAws_restJson1OutputLocation ( output . outputLocation , context ) : undefined , robotApplications : output . robotApplications !== undefined && output . robotApplications !== null ? deserializeAws_restJson1RobotApplicationConfigs ( output . robotApplications , context ) : undefined , simulationApplications : output . simulationApplications !== undefined && output . simulationApplications !== null ? deserializeAws_restJson1SimulationApplicationConfigs ( output . simulationApplications , context ) : undefined , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_restJson1TagMap ( output . tags , context ) : undefined , useDefaultApplications : __expectBoolean ( output . useDefaultApplications ) , vpcConfig : output . vpcConfig !== undefined && output . vpcConfig !== null ? deserializeAws_restJson1VPCConfig ( output . vpcConfig , context ) : undefined , } as any ; } ; const deserializeAws_restJson1SimulationJobs = ( output , context ) : SimulationJob [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationJob ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SimulationJobSummaries = ( output , context ) : SimulationJobSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1SimulationJobSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SimulationJobSummary = ( output , context ) : SimulationJobSummary => { return { arn : __expectString ( output . arn ) , computeType : __expectString ( output . computeType ) , dataSourceNames : output . dataSourceNames !== undefined && output . dataSourceNames !== null ? deserializeAws_restJson1DataSourceNames ( output . dataSourceNames , context ) : undefined , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , name : __expectString ( output . name ) , robotApplicationNames : output . robotApplicationNames !== undefined && output . robotApplicationNames !== null ? deserializeAws_restJson1RobotApplicationNames ( output . robotApplicationNames , context ) : undefined , simulationApplicationNames : output . simulationApplicationNames !== undefined && output . simulationApplicationNames !== null ? deserializeAws_restJson1SimulationApplicationNames ( output . simulationApplicationNames , context ) : undefined , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_restJson1SimulationSoftwareSuite = ( output , context ) : SimulationSoftwareSuite => { return { name : __expectString ( output . name ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1Source = ( output , context ) : Source => { return { architecture : __expectString ( output . architecture ) , etag : __expectString ( output . etag ) , s3Bucket : __expectString ( output . s3Bucket ) , s3Key : __expectString ( output . s3Key ) , } as any ; } ; const deserializeAws_restJson1Sources = ( output , context ) : Source [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Source ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1Subnets = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1TagMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_restJson1TemplateSummaries = ( output , context ) : TemplateSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TemplateSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TemplateSummary = ( output , context ) : TemplateSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , lastUpdatedAt : output . lastUpdatedAt !== undefined && output . lastUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastUpdatedAt ) ) ) : undefined , name : __expectString ( output . name ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_restJson1Tool = ( output , context ) : Tool => { return { command : __expectString ( output . command ) , exitBehavior : __expectString ( output . exitBehavior ) , name : __expectString ( output . name ) , streamOutputToCloudWatch : __expectBoolean ( output . streamOutputToCloudWatch ) , streamUI : __expectBoolean ( output . streamUI ) , } as any ; } ; const deserializeAws_restJson1Tools = ( output , context ) : Tool [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Tool ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1UploadConfiguration = ( output , context ) : UploadConfiguration => { return { name : __expectString ( output . name ) , path : __expectString ( output . path ) , uploadBehavior : __expectString ( output . uploadBehavior ) , } as any ; } ; const deserializeAws_restJson1UploadConfigurations = ( output , context ) : UploadConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1UploadConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1VPCConfig = ( output , context ) : VPCConfig => { return { assignPublicIp : __expectBoolean ( output . assignPublicIp ) , securityGroups : output . securityGroups !== undefined && output . securityGroups !== null ? deserializeAws_restJson1SecurityGroups ( output . securityGroups , context ) : undefined , subnets : output . subnets !== undefined && output . subnets !== null ? deserializeAws_restJson1Subnets ( output . subnets , context ) : undefined , } as any ; } ; const deserializeAws_restJson1VPCConfigResponse = ( output , context ) : VPCConfigResponse => { return { assignPublicIp : __expectBoolean ( output . assignPublicIp ) , securityGroups : output . securityGroups !== undefined && output . securityGroups !== null ? deserializeAws_restJson1SecurityGroups ( output . securityGroups , context ) : undefined , subnets : output . subnets !== undefined && output . subnets !== null ? deserializeAws_restJson1Subnets ( output . subnets , context ) : undefined , vpcId : __expectString ( output . vpcId ) , } as any ; } ; const deserializeAws_restJson1WorldConfig = ( output , context ) : WorldConfig => { return { world : __expectString ( output . world ) , } as any ; } ; const deserializeAws_restJson1WorldConfigs = ( output , context ) : WorldConfig [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1WorldConfig ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1WorldCount = ( output , context ) : WorldCount => { return { floorplanCount : __expectInt32 ( output . floorplanCount ) , interiorCountPerFloorplan : __expectInt32 ( output . interiorCountPerFloorplan ) , } as any ; } ; const deserializeAws_restJson1WorldExportJobSummaries = ( output , context ) : WorldExportJobSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1WorldExportJobSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1WorldExportJobSummary = ( output , context ) : WorldExportJobSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , status : __expectString ( output . status ) , worlds : output . worlds !== undefined && output . worlds !== null ? deserializeAws_restJson1Arns ( output . worlds , context ) : undefined , } as any ; } ; const deserializeAws_restJson1WorldFailure = ( output , context ) : WorldFailure => { return { failureCode : __expectString ( output . failureCode ) , failureCount : __expectInt32 ( output . failureCount ) , sampleFailureReason : __expectString ( output . sampleFailureReason ) , } as any ; } ; const deserializeAws_restJson1WorldFailures = ( output , context ) : WorldFailure [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1WorldFailure ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1WorldGenerationJobSummaries = ( output , context ) : WorldGenerationJobSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1WorldGenerationJobSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1WorldGenerationJobSummary = ( output , context ) : WorldGenerationJobSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , failedWorldCount : __expectInt32 ( output . failedWorldCount ) , status : __expectString ( output . status ) , succeededWorldCount : __expectInt32 ( output . succeededWorldCount ) , template : __expectString ( output . template ) , worldCount : output . worldCount !== undefined && output . worldCount !== null ? deserializeAws_restJson1WorldCount ( output . worldCount , context ) : undefined , } as any ; } ; const deserializeAws_restJson1WorldSummaries = ( output , context ) : WorldSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1WorldSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1WorldSummary = ( output , context ) : WorldSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , generationJob : __expectString ( output . generationJob ) , template : __expectString ( output . template ) , } 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 isSerializableHeaderValue = ( value ) : boolean => value !== undefined && value !== null && value !== "" && ( ! Object . getOwnPropertyNames ( value ) . includes ( "length" ) || value . length != 0 ) && ( ! Object . getOwnPropertyNames ( value ) . includes ( "size" ) || value . size != 0 ) ; 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 "" ; } ;