import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , limitedParseDouble as __limitedParseDouble , limitedParseFloat32 as __limitedParseFloat32 , parseEpochTimestamp as __parseEpochTimestamp , serializeFloat as __serializeFloat , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { AcceptMatchCommandInput , AcceptMatchCommandOutput } from "../commands/AcceptMatchCommand" ; import { ClaimGameServerCommandInput , ClaimGameServerCommandOutput } from "../commands/ClaimGameServerCommand" ; import { CreateAliasCommandInput , CreateAliasCommandOutput } from "../commands/CreateAliasCommand" ; import { CreateBuildCommandInput , CreateBuildCommandOutput } from "../commands/CreateBuildCommand" ; import { CreateFleetCommandInput , CreateFleetCommandOutput } from "../commands/CreateFleetCommand" ; import { CreateFleetLocationsCommandInput , CreateFleetLocationsCommandOutput , } from "../commands/CreateFleetLocationsCommand" ; import { CreateGameServerGroupCommandInput , CreateGameServerGroupCommandOutput , } from "../commands/CreateGameServerGroupCommand" ; import { CreateGameSessionCommandInput , CreateGameSessionCommandOutput } from "../commands/CreateGameSessionCommand" ; import { CreateGameSessionQueueCommandInput , CreateGameSessionQueueCommandOutput , } from "../commands/CreateGameSessionQueueCommand" ; import { CreateMatchmakingConfigurationCommandInput , CreateMatchmakingConfigurationCommandOutput , } from "../commands/CreateMatchmakingConfigurationCommand" ; import { CreateMatchmakingRuleSetCommandInput , CreateMatchmakingRuleSetCommandOutput , } from "../commands/CreateMatchmakingRuleSetCommand" ; import { CreatePlayerSessionCommandInput , CreatePlayerSessionCommandOutput , } from "../commands/CreatePlayerSessionCommand" ; import { CreatePlayerSessionsCommandInput , CreatePlayerSessionsCommandOutput , } from "../commands/CreatePlayerSessionsCommand" ; import { CreateScriptCommandInput , CreateScriptCommandOutput } from "../commands/CreateScriptCommand" ; import { CreateVpcPeeringAuthorizationCommandInput , CreateVpcPeeringAuthorizationCommandOutput , } from "../commands/CreateVpcPeeringAuthorizationCommand" ; import { CreateVpcPeeringConnectionCommandInput , CreateVpcPeeringConnectionCommandOutput , } from "../commands/CreateVpcPeeringConnectionCommand" ; import { DeleteAliasCommandInput , DeleteAliasCommandOutput } from "../commands/DeleteAliasCommand" ; import { DeleteBuildCommandInput , DeleteBuildCommandOutput } from "../commands/DeleteBuildCommand" ; import { DeleteFleetCommandInput , DeleteFleetCommandOutput } from "../commands/DeleteFleetCommand" ; import { DeleteFleetLocationsCommandInput , DeleteFleetLocationsCommandOutput , } from "../commands/DeleteFleetLocationsCommand" ; import { DeleteGameServerGroupCommandInput , DeleteGameServerGroupCommandOutput , } from "../commands/DeleteGameServerGroupCommand" ; import { DeleteGameSessionQueueCommandInput , DeleteGameSessionQueueCommandOutput , } from "../commands/DeleteGameSessionQueueCommand" ; import { DeleteMatchmakingConfigurationCommandInput , DeleteMatchmakingConfigurationCommandOutput , } from "../commands/DeleteMatchmakingConfigurationCommand" ; import { DeleteMatchmakingRuleSetCommandInput , DeleteMatchmakingRuleSetCommandOutput , } from "../commands/DeleteMatchmakingRuleSetCommand" ; import { DeleteScalingPolicyCommandInput , DeleteScalingPolicyCommandOutput , } from "../commands/DeleteScalingPolicyCommand" ; import { DeleteScriptCommandInput , DeleteScriptCommandOutput } from "../commands/DeleteScriptCommand" ; import { DeleteVpcPeeringAuthorizationCommandInput , DeleteVpcPeeringAuthorizationCommandOutput , } from "../commands/DeleteVpcPeeringAuthorizationCommand" ; import { DeleteVpcPeeringConnectionCommandInput , DeleteVpcPeeringConnectionCommandOutput , } from "../commands/DeleteVpcPeeringConnectionCommand" ; import { DeregisterGameServerCommandInput , DeregisterGameServerCommandOutput , } from "../commands/DeregisterGameServerCommand" ; import { DescribeAliasCommandInput , DescribeAliasCommandOutput } from "../commands/DescribeAliasCommand" ; import { DescribeBuildCommandInput , DescribeBuildCommandOutput } from "../commands/DescribeBuildCommand" ; import { DescribeEC2InstanceLimitsCommandInput , DescribeEC2InstanceLimitsCommandOutput , } from "../commands/DescribeEC2InstanceLimitsCommand" ; import { DescribeFleetAttributesCommandInput , DescribeFleetAttributesCommandOutput , } from "../commands/DescribeFleetAttributesCommand" ; import { DescribeFleetCapacityCommandInput , DescribeFleetCapacityCommandOutput , } from "../commands/DescribeFleetCapacityCommand" ; import { DescribeFleetEventsCommandInput , DescribeFleetEventsCommandOutput , } from "../commands/DescribeFleetEventsCommand" ; import { DescribeFleetLocationAttributesCommandInput , DescribeFleetLocationAttributesCommandOutput , } from "../commands/DescribeFleetLocationAttributesCommand" ; import { DescribeFleetLocationCapacityCommandInput , DescribeFleetLocationCapacityCommandOutput , } from "../commands/DescribeFleetLocationCapacityCommand" ; import { DescribeFleetLocationUtilizationCommandInput , DescribeFleetLocationUtilizationCommandOutput , } from "../commands/DescribeFleetLocationUtilizationCommand" ; import { DescribeFleetPortSettingsCommandInput , DescribeFleetPortSettingsCommandOutput , } from "../commands/DescribeFleetPortSettingsCommand" ; import { DescribeFleetUtilizationCommandInput , DescribeFleetUtilizationCommandOutput , } from "../commands/DescribeFleetUtilizationCommand" ; import { DescribeGameServerCommandInput , DescribeGameServerCommandOutput } from "../commands/DescribeGameServerCommand" ; import { DescribeGameServerGroupCommandInput , DescribeGameServerGroupCommandOutput , } from "../commands/DescribeGameServerGroupCommand" ; import { DescribeGameServerInstancesCommandInput , DescribeGameServerInstancesCommandOutput , } from "../commands/DescribeGameServerInstancesCommand" ; import { DescribeGameSessionDetailsCommandInput , DescribeGameSessionDetailsCommandOutput , } from "../commands/DescribeGameSessionDetailsCommand" ; import { DescribeGameSessionPlacementCommandInput , DescribeGameSessionPlacementCommandOutput , } from "../commands/DescribeGameSessionPlacementCommand" ; import { DescribeGameSessionQueuesCommandInput , DescribeGameSessionQueuesCommandOutput , } from "../commands/DescribeGameSessionQueuesCommand" ; import { DescribeGameSessionsCommandInput , DescribeGameSessionsCommandOutput , } from "../commands/DescribeGameSessionsCommand" ; import { DescribeInstancesCommandInput , DescribeInstancesCommandOutput } from "../commands/DescribeInstancesCommand" ; import { DescribeMatchmakingCommandInput , DescribeMatchmakingCommandOutput , } from "../commands/DescribeMatchmakingCommand" ; import { DescribeMatchmakingConfigurationsCommandInput , DescribeMatchmakingConfigurationsCommandOutput , } from "../commands/DescribeMatchmakingConfigurationsCommand" ; import { DescribeMatchmakingRuleSetsCommandInput , DescribeMatchmakingRuleSetsCommandOutput , } from "../commands/DescribeMatchmakingRuleSetsCommand" ; import { DescribePlayerSessionsCommandInput , DescribePlayerSessionsCommandOutput , } from "../commands/DescribePlayerSessionsCommand" ; import { DescribeRuntimeConfigurationCommandInput , DescribeRuntimeConfigurationCommandOutput , } from "../commands/DescribeRuntimeConfigurationCommand" ; import { DescribeScalingPoliciesCommandInput , DescribeScalingPoliciesCommandOutput , } from "../commands/DescribeScalingPoliciesCommand" ; import { DescribeScriptCommandInput , DescribeScriptCommandOutput } from "../commands/DescribeScriptCommand" ; import { DescribeVpcPeeringAuthorizationsCommandInput , DescribeVpcPeeringAuthorizationsCommandOutput , } from "../commands/DescribeVpcPeeringAuthorizationsCommand" ; import { DescribeVpcPeeringConnectionsCommandInput , DescribeVpcPeeringConnectionsCommandOutput , } from "../commands/DescribeVpcPeeringConnectionsCommand" ; import { GetGameSessionLogUrlCommandInput , GetGameSessionLogUrlCommandOutput , } from "../commands/GetGameSessionLogUrlCommand" ; import { GetInstanceAccessCommandInput , GetInstanceAccessCommandOutput } from "../commands/GetInstanceAccessCommand" ; import { ListAliasesCommandInput , ListAliasesCommandOutput } from "../commands/ListAliasesCommand" ; import { ListBuildsCommandInput , ListBuildsCommandOutput } from "../commands/ListBuildsCommand" ; import { ListFleetsCommandInput , ListFleetsCommandOutput } from "../commands/ListFleetsCommand" ; import { ListGameServerGroupsCommandInput , ListGameServerGroupsCommandOutput , } from "../commands/ListGameServerGroupsCommand" ; import { ListGameServersCommandInput , ListGameServersCommandOutput } from "../commands/ListGameServersCommand" ; import { ListScriptsCommandInput , ListScriptsCommandOutput } from "../commands/ListScriptsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { PutScalingPolicyCommandInput , PutScalingPolicyCommandOutput } from "../commands/PutScalingPolicyCommand" ; import { RegisterGameServerCommandInput , RegisterGameServerCommandOutput } from "../commands/RegisterGameServerCommand" ; import { RequestUploadCredentialsCommandInput , RequestUploadCredentialsCommandOutput , } from "../commands/RequestUploadCredentialsCommand" ; import { ResolveAliasCommandInput , ResolveAliasCommandOutput } from "../commands/ResolveAliasCommand" ; import { ResumeGameServerGroupCommandInput , ResumeGameServerGroupCommandOutput , } from "../commands/ResumeGameServerGroupCommand" ; import { SearchGameSessionsCommandInput , SearchGameSessionsCommandOutput } from "../commands/SearchGameSessionsCommand" ; import { StartFleetActionsCommandInput , StartFleetActionsCommandOutput } from "../commands/StartFleetActionsCommand" ; import { StartGameSessionPlacementCommandInput , StartGameSessionPlacementCommandOutput , } from "../commands/StartGameSessionPlacementCommand" ; import { StartMatchBackfillCommandInput , StartMatchBackfillCommandOutput } from "../commands/StartMatchBackfillCommand" ; import { StartMatchmakingCommandInput , StartMatchmakingCommandOutput } from "../commands/StartMatchmakingCommand" ; import { StopFleetActionsCommandInput , StopFleetActionsCommandOutput } from "../commands/StopFleetActionsCommand" ; import { StopGameSessionPlacementCommandInput , StopGameSessionPlacementCommandOutput , } from "../commands/StopGameSessionPlacementCommand" ; import { StopMatchmakingCommandInput , StopMatchmakingCommandOutput } from "../commands/StopMatchmakingCommand" ; import { SuspendGameServerGroupCommandInput , SuspendGameServerGroupCommandOutput , } from "../commands/SuspendGameServerGroupCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateAliasCommandInput , UpdateAliasCommandOutput } from "../commands/UpdateAliasCommand" ; import { UpdateBuildCommandInput , UpdateBuildCommandOutput } from "../commands/UpdateBuildCommand" ; import { UpdateFleetAttributesCommandInput , UpdateFleetAttributesCommandOutput , } from "../commands/UpdateFleetAttributesCommand" ; import { UpdateFleetCapacityCommandInput , UpdateFleetCapacityCommandOutput , } from "../commands/UpdateFleetCapacityCommand" ; import { UpdateFleetPortSettingsCommandInput , UpdateFleetPortSettingsCommandOutput , } from "../commands/UpdateFleetPortSettingsCommand" ; import { UpdateGameServerCommandInput , UpdateGameServerCommandOutput } from "../commands/UpdateGameServerCommand" ; import { UpdateGameServerGroupCommandInput , UpdateGameServerGroupCommandOutput , } from "../commands/UpdateGameServerGroupCommand" ; import { UpdateGameSessionCommandInput , UpdateGameSessionCommandOutput } from "../commands/UpdateGameSessionCommand" ; import { UpdateGameSessionQueueCommandInput , UpdateGameSessionQueueCommandOutput , } from "../commands/UpdateGameSessionQueueCommand" ; import { UpdateMatchmakingConfigurationCommandInput , UpdateMatchmakingConfigurationCommandOutput , } from "../commands/UpdateMatchmakingConfigurationCommand" ; import { UpdateRuntimeConfigurationCommandInput , UpdateRuntimeConfigurationCommandOutput , } from "../commands/UpdateRuntimeConfigurationCommand" ; import { UpdateScriptCommandInput , UpdateScriptCommandOutput } from "../commands/UpdateScriptCommand" ; import { ValidateMatchmakingRuleSetCommandInput , ValidateMatchmakingRuleSetCommandOutput , } from "../commands/ValidateMatchmakingRuleSetCommand" ; import { AcceptMatchInput , AcceptMatchOutput , Alias , AttributeValue , AwsCredentials , Build , CertificateConfiguration , ClaimGameServerInput , ClaimGameServerOutput , ConflictException , CreateAliasInput , CreateAliasOutput , CreateBuildInput , CreateBuildOutput , CreateFleetInput , CreateFleetLocationsInput , CreateFleetLocationsOutput , CreateFleetOutput , CreateGameServerGroupInput , CreateGameServerGroupOutput , CreateGameSessionInput , CreateGameSessionOutput , CreateGameSessionQueueInput , CreateGameSessionQueueOutput , CreateMatchmakingConfigurationInput , CreateMatchmakingConfigurationOutput , CreateMatchmakingRuleSetInput , CreateMatchmakingRuleSetOutput , CreatePlayerSessionInput , CreatePlayerSessionOutput , CreatePlayerSessionsInput , CreatePlayerSessionsOutput , CreateScriptInput , CreateScriptOutput , CreateVpcPeeringAuthorizationInput , CreateVpcPeeringAuthorizationOutput , CreateVpcPeeringConnectionInput , CreateVpcPeeringConnectionOutput , DeleteAliasInput , DeleteBuildInput , DeleteFleetInput , DeleteFleetLocationsInput , DeleteFleetLocationsOutput , DeleteGameServerGroupInput , DeleteGameServerGroupOutput , DeleteGameSessionQueueInput , DeleteGameSessionQueueOutput , DeleteMatchmakingConfigurationInput , DeleteMatchmakingConfigurationOutput , DeleteMatchmakingRuleSetInput , DeleteMatchmakingRuleSetOutput , DeleteScalingPolicyInput , DeleteScriptInput , DeleteVpcPeeringAuthorizationInput , DeleteVpcPeeringAuthorizationOutput , DeleteVpcPeeringConnectionInput , DeleteVpcPeeringConnectionOutput , DeregisterGameServerInput , DescribeAliasInput , DescribeAliasOutput , DescribeBuildInput , DescribeBuildOutput , DescribeEC2InstanceLimitsInput , DescribeEC2InstanceLimitsOutput , DescribeFleetAttributesInput , DescribeFleetAttributesOutput , DescribeFleetCapacityInput , DescribeFleetCapacityOutput , DescribeFleetEventsInput , DescribeFleetEventsOutput , DescribeFleetLocationAttributesInput , DescribeFleetLocationAttributesOutput , DescribeFleetLocationCapacityInput , DescribeFleetLocationCapacityOutput , DescribeFleetLocationUtilizationInput , DescribeFleetLocationUtilizationOutput , DescribeFleetPortSettingsInput , DescribeFleetPortSettingsOutput , DescribeFleetUtilizationInput , DescribeFleetUtilizationOutput , DescribeGameServerGroupInput , DescribeGameServerGroupOutput , DescribeGameServerInput , DescribeGameServerInstancesInput , DescribeGameServerInstancesOutput , DescribeGameServerOutput , DescribeGameSessionDetailsInput , DescribeGameSessionDetailsOutput , DescribeGameSessionPlacementInput , DescribeGameSessionPlacementOutput , DescribeGameSessionQueuesInput , DescribeGameSessionQueuesOutput , DescribeGameSessionsInput , DescribeGameSessionsOutput , DescribeInstancesInput , DescribeInstancesOutput , DescribeMatchmakingConfigurationsInput , DescribeMatchmakingConfigurationsOutput , DescribeMatchmakingInput , DescribeMatchmakingOutput , DescribeMatchmakingRuleSetsInput , DescribeMatchmakingRuleSetsOutput , DescribePlayerSessionsInput , DescribePlayerSessionsOutput , DescribeRuntimeConfigurationInput , DescribeRuntimeConfigurationOutput , DescribeScalingPoliciesInput , DescribeScalingPoliciesOutput , DescribeScriptInput , DescribeScriptOutput , DescribeVpcPeeringAuthorizationsInput , DescribeVpcPeeringAuthorizationsOutput , DescribeVpcPeeringConnectionsInput , DescribeVpcPeeringConnectionsOutput , DesiredPlayerSession , EC2InstanceCounts , EC2InstanceLimit , Event , FilterConfiguration , FleetAction , FleetAttributes , FleetCapacity , FleetCapacityExceededException , FleetUtilization , GameProperty , GameServer , GameServerGroup , GameServerGroupAction , GameServerGroupAutoScalingPolicy , GameServerInstance , GameSession , GameSessionConnectionInfo , GameSessionDetail , GameSessionFullException , GameSessionPlacement , GameSessionQueue , GameSessionQueueDestination , GetGameSessionLogUrlInput , GetGameSessionLogUrlOutput , GetInstanceAccessInput , GetInstanceAccessOutput , IdempotentParameterMismatchException , Instance , InstanceAccess , InstanceCredentials , InstanceDefinition , InternalServiceException , InvalidFleetStatusException , InvalidGameSessionStatusException , InvalidRequestException , IpPermission , LaunchTemplateSpecification , LimitExceededException , ListAliasesInput , ListAliasesOutput , ListBuildsInput , ListBuildsOutput , ListFleetsInput , ListFleetsOutput , ListGameServerGroupsInput , ListGameServerGroupsOutput , ListGameServersInput , ListGameServersOutput , ListScriptsInput , ListScriptsOutput , ListTagsForResourceRequest , ListTagsForResourceResponse , LocationAttributes , LocationConfiguration , LocationState , MatchedPlayerSession , MatchmakingConfiguration , MatchmakingRuleSet , MatchmakingTicket , NotFoundException , OutOfCapacityException , PlacedPlayerSession , Player , PlayerLatency , PlayerLatencyPolicy , PlayerSession , PriorityConfiguration , PriorityType , PutScalingPolicyInput , PutScalingPolicyOutput , RegisterGameServerInput , RegisterGameServerOutput , RequestUploadCredentialsInput , RequestUploadCredentialsOutput , ResolveAliasInput , ResolveAliasOutput , ResourceCreationLimitPolicy , ResumeGameServerGroupInput , ResumeGameServerGroupOutput , RoutingStrategy , RuntimeConfiguration , S3Location , ScalingPolicy , Script , SearchGameSessionsInput , SearchGameSessionsOutput , ServerProcess , StartFleetActionsInput , StartFleetActionsOutput , StartGameSessionPlacementInput , StartGameSessionPlacementOutput , StartMatchBackfillInput , StartMatchBackfillOutput , StartMatchmakingInput , StartMatchmakingOutput , StopFleetActionsInput , StopFleetActionsOutput , StopGameSessionPlacementInput , StopGameSessionPlacementOutput , StopMatchmakingInput , StopMatchmakingOutput , SuspendGameServerGroupInput , SuspendGameServerGroupOutput , Tag , TaggingFailedException , TagResourceRequest , TagResourceResponse , TargetConfiguration , TargetTrackingConfiguration , TerminalRoutingStrategyException , UnauthorizedException , UnsupportedRegionException , UntagResourceRequest , UntagResourceResponse , UpdateAliasInput , UpdateAliasOutput , UpdateBuildInput , UpdateBuildOutput , UpdateFleetAttributesInput , UpdateFleetAttributesOutput , UpdateFleetCapacityInput , UpdateFleetCapacityOutput , UpdateFleetPortSettingsInput , UpdateFleetPortSettingsOutput , UpdateGameServerGroupInput , UpdateGameServerGroupOutput , UpdateGameServerInput , UpdateGameServerOutput , UpdateGameSessionInput , UpdateGameSessionOutput , UpdateGameSessionQueueInput , UpdateGameSessionQueueOutput , UpdateMatchmakingConfigurationInput , UpdateMatchmakingConfigurationOutput , UpdateRuntimeConfigurationInput , UpdateRuntimeConfigurationOutput , UpdateScriptInput , UpdateScriptOutput , ValidateMatchmakingRuleSetInput , ValidateMatchmakingRuleSetOutput , VpcPeeringAuthorization , VpcPeeringConnection , VpcPeeringConnectionStatus , } from "../models/models_0" ; export const serializeAws_json1_1AcceptMatchCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.AcceptMatch" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AcceptMatchInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ClaimGameServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ClaimGameServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ClaimGameServerInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateAliasInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateBuildCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateBuild" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateBuildInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateFleetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateFleet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateFleetInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateFleetLocationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateFleetLocations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateFleetLocationsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGameSessionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateGameSession" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGameSessionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGameSessionQueueCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateGameSessionQueue" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGameSessionQueueInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateMatchmakingConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateMatchmakingConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateMatchmakingConfigurationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateMatchmakingRuleSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateMatchmakingRuleSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateMatchmakingRuleSetInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreatePlayerSessionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreatePlayerSession" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreatePlayerSessionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreatePlayerSessionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreatePlayerSessions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreatePlayerSessionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateScriptCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateScript" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateScriptInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateVpcPeeringAuthorizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateVpcPeeringAuthorization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateVpcPeeringAuthorizationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateVpcPeeringConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.CreateVpcPeeringConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateVpcPeeringConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteAliasInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteBuildCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteBuild" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteBuildInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteFleetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteFleet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteFleetInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteFleetLocationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteFleetLocations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteFleetLocationsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteGameSessionQueueCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteGameSessionQueue" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteGameSessionQueueInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteMatchmakingConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteMatchmakingConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteMatchmakingConfigurationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteMatchmakingRuleSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteMatchmakingRuleSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteMatchmakingRuleSetInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteScalingPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteScalingPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteScalingPolicyInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteScriptCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteScript" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteScriptInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteVpcPeeringAuthorizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteVpcPeeringAuthorization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteVpcPeeringAuthorizationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteVpcPeeringConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeleteVpcPeeringConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteVpcPeeringConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeregisterGameServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DeregisterGameServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeregisterGameServerInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAliasInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeBuildCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeBuild" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeBuildInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeEC2InstanceLimitsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeEC2InstanceLimits" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeEC2InstanceLimitsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetAttributesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetCapacityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetCapacity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetCapacityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetEventsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetEvents" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetEventsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetLocationAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetLocationAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetLocationAttributesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetLocationCapacityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetLocationCapacity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetLocationCapacityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetLocationUtilizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetLocationUtilization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetLocationUtilizationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetPortSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetPortSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetPortSettingsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeFleetUtilizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeFleetUtilization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeFleetUtilizationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameServerInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameServerInstancesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameServerInstances" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameServerInstancesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameSessionDetailsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameSessionDetails" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameSessionDetailsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameSessionPlacementCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameSessionPlacement" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameSessionPlacementInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameSessionQueuesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameSessionQueues" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameSessionQueuesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeGameSessionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeGameSessions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeGameSessionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeInstancesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeInstances" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeInstancesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeMatchmakingCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeMatchmaking" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeMatchmakingInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeMatchmakingConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeMatchmakingConfigurations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeMatchmakingConfigurationsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeMatchmakingRuleSetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeMatchmakingRuleSets" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeMatchmakingRuleSetsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribePlayerSessionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribePlayerSessions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribePlayerSessionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeRuntimeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeRuntimeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeRuntimeConfigurationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeScalingPoliciesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeScalingPolicies" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeScalingPoliciesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeScriptCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeScript" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeScriptInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeVpcPeeringAuthorizations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeVpcPeeringAuthorizationsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeVpcPeeringConnectionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.DescribeVpcPeeringConnections" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeVpcPeeringConnectionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetGameSessionLogUrlCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.GetGameSessionLogUrl" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetGameSessionLogUrlInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetInstanceAccessCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.GetInstanceAccess" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetInstanceAccessInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListAliases" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAliasesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListBuildsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListBuilds" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListBuildsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListFleetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListFleets" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListFleetsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListGameServerGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListGameServerGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListGameServerGroupsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListGameServersCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListGameServers" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListGameServersInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListScriptsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListScripts" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListScriptsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutScalingPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.PutScalingPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutScalingPolicyInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RegisterGameServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.RegisterGameServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RegisterGameServerInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RequestUploadCredentialsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.RequestUploadCredentials" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RequestUploadCredentialsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ResolveAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ResolveAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ResolveAliasInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ResumeGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ResumeGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ResumeGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SearchGameSessionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.SearchGameSessions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SearchGameSessionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartFleetActionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StartFleetActions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartFleetActionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartGameSessionPlacementCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StartGameSessionPlacement" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartGameSessionPlacementInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartMatchBackfillCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StartMatchBackfill" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartMatchBackfillInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartMatchmakingCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StartMatchmaking" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartMatchmakingInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopFleetActionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StopFleetActions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopFleetActionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopGameSessionPlacementCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StopGameSessionPlacement" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopGameSessionPlacementInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopMatchmakingCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.StopMatchmaking" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopMatchmakingInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SuspendGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.SuspendGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SuspendGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateAliasInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateBuildCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateBuild" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateBuildInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateFleetAttributesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateFleetAttributes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateFleetAttributesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateFleetCapacityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateFleetCapacity" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateFleetCapacityInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateFleetPortSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateFleetPortSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateFleetPortSettingsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateGameServerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateGameServer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateGameServerInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateGameServerGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateGameServerGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateGameServerGroupInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateGameSessionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateGameSession" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateGameSessionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateGameSessionQueueCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateGameSessionQueue" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateGameSessionQueueInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateMatchmakingConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateMatchmakingConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateMatchmakingConfigurationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateRuntimeConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateRuntimeConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateRuntimeConfigurationInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateScriptCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.UpdateScript" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateScriptInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ValidateMatchmakingRuleSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "GameLift.ValidateMatchmakingRuleSet" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ValidateMatchmakingRuleSetInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AcceptMatchCommand = async ( output , context ) : Promise < AcceptMatchCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AcceptMatchCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AcceptMatchOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AcceptMatchCommandError = async ( output , context ) : Promise < AcceptMatchCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ClaimGameServerCommand = async ( output , context ) : Promise < ClaimGameServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ClaimGameServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ClaimGameServerOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ClaimGameServerCommandError = async ( output , context ) : Promise < ClaimGameServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OutOfCapacityException" : case "com.amazonaws.gamelift#OutOfCapacityException" : response = { ... ( await deserializeAws_json1_1OutOfCapacityExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateAliasCommand = async ( output , context ) : Promise < CreateAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateAliasOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateAliasCommandError = async ( output , context ) : Promise < CreateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateBuildCommand = async ( output , context ) : Promise < CreateBuildCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateBuildCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateBuildOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateBuildCommandError = async ( output , context ) : Promise < CreateBuildCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateFleetCommand = async ( output , context ) : Promise < CreateFleetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateFleetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateFleetOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateFleetCommandError = 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 "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateFleetLocationsCommand = async ( output , context ) : Promise < CreateFleetLocationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateFleetLocationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateFleetLocationsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateFleetLocationsCommandError = async ( output , context ) : Promise < CreateFleetLocationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateGameServerGroupCommand = async ( output , context ) : Promise < CreateGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGameServerGroupCommandError = async ( output , context ) : Promise < CreateGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateGameSessionCommand = async ( output , context ) : Promise < CreateGameSessionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGameSessionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGameSessionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGameSessionCommandError = async ( output , context ) : Promise < CreateGameSessionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FleetCapacityExceededException" : case "com.amazonaws.gamelift#FleetCapacityExceededException" : response = { ... ( await deserializeAws_json1_1FleetCapacityExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IdempotentParameterMismatchException" : case "com.amazonaws.gamelift#IdempotentParameterMismatchException" : response = { ... ( await deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateGameSessionQueueCommand = async ( output , context ) : Promise < CreateGameSessionQueueCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGameSessionQueueCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGameSessionQueueOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGameSessionQueueCommandError = async ( output , context ) : Promise < CreateGameSessionQueueCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateMatchmakingConfigurationCommand = async ( output , context ) : Promise < CreateMatchmakingConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateMatchmakingConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateMatchmakingConfigurationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateMatchmakingConfigurationCommandError = async ( output , context ) : Promise < CreateMatchmakingConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateMatchmakingRuleSetCommand = async ( output , context ) : Promise < CreateMatchmakingRuleSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateMatchmakingRuleSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateMatchmakingRuleSetOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateMatchmakingRuleSetCommandError = async ( output , context ) : Promise < CreateMatchmakingRuleSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreatePlayerSessionCommand = async ( output , context ) : Promise < CreatePlayerSessionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreatePlayerSessionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreatePlayerSessionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreatePlayerSessionCommandError = async ( output , context ) : Promise < CreatePlayerSessionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "GameSessionFullException" : case "com.amazonaws.gamelift#GameSessionFullException" : response = { ... ( await deserializeAws_json1_1GameSessionFullExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGameSessionStatusException" : case "com.amazonaws.gamelift#InvalidGameSessionStatusException" : response = { ... ( await deserializeAws_json1_1InvalidGameSessionStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreatePlayerSessionsCommand = async ( output , context ) : Promise < CreatePlayerSessionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreatePlayerSessionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreatePlayerSessionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreatePlayerSessionsCommandError = async ( output , context ) : Promise < CreatePlayerSessionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "GameSessionFullException" : case "com.amazonaws.gamelift#GameSessionFullException" : response = { ... ( await deserializeAws_json1_1GameSessionFullExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGameSessionStatusException" : case "com.amazonaws.gamelift#InvalidGameSessionStatusException" : response = { ... ( await deserializeAws_json1_1InvalidGameSessionStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateScriptCommand = async ( output , context ) : Promise < CreateScriptCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateScriptCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateScriptOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateScriptCommandError = async ( output , context ) : Promise < CreateScriptCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateVpcPeeringAuthorizationCommand = async ( output , context ) : Promise < CreateVpcPeeringAuthorizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateVpcPeeringAuthorizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateVpcPeeringAuthorizationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateVpcPeeringAuthorizationCommandError = async ( output , context ) : Promise < CreateVpcPeeringAuthorizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateVpcPeeringConnectionCommand = async ( output , context ) : Promise < CreateVpcPeeringConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateVpcPeeringConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateVpcPeeringConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateVpcPeeringConnectionCommandError = async ( output , context ) : Promise < CreateVpcPeeringConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteAliasCommand = async ( output , context ) : Promise < DeleteAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteAliasCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteAliasCommandError = async ( output , context ) : Promise < DeleteAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteBuildCommand = async ( output , context ) : Promise < DeleteBuildCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteBuildCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteBuildCommandError = async ( output , context ) : Promise < DeleteBuildCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteFleetCommand = async ( output , context ) : Promise < DeleteFleetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteFleetCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteFleetCommandError = 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 "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteFleetLocationsCommand = async ( output , context ) : Promise < DeleteFleetLocationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteFleetLocationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteFleetLocationsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteFleetLocationsCommandError = async ( output , context ) : Promise < DeleteFleetLocationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteGameServerGroupCommand = async ( output , context ) : Promise < DeleteGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteGameServerGroupCommandError = async ( output , context ) : Promise < DeleteGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteGameSessionQueueCommand = async ( output , context ) : Promise < DeleteGameSessionQueueCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteGameSessionQueueCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteGameSessionQueueOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteGameSessionQueueCommandError = async ( output , context ) : Promise < DeleteGameSessionQueueCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteMatchmakingConfigurationCommand = async ( output , context ) : Promise < DeleteMatchmakingConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteMatchmakingConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteMatchmakingConfigurationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteMatchmakingConfigurationCommandError = async ( output , context ) : Promise < DeleteMatchmakingConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteMatchmakingRuleSetCommand = async ( output , context ) : Promise < DeleteMatchmakingRuleSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteMatchmakingRuleSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteMatchmakingRuleSetOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteMatchmakingRuleSetCommandError = async ( output , context ) : Promise < DeleteMatchmakingRuleSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteScalingPolicyCommand = async ( output , context ) : Promise < DeleteScalingPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteScalingPolicyCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteScalingPolicyCommandError = async ( output , context ) : Promise < DeleteScalingPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteScriptCommand = async ( output , context ) : Promise < DeleteScriptCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteScriptCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteScriptCommandError = async ( output , context ) : Promise < DeleteScriptCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommand = async ( output , context ) : Promise < DeleteVpcPeeringAuthorizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteVpcPeeringAuthorizationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteVpcPeeringAuthorizationCommandError = async ( output , context ) : Promise < DeleteVpcPeeringAuthorizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteVpcPeeringConnectionCommand = async ( output , context ) : Promise < DeleteVpcPeeringConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteVpcPeeringConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteVpcPeeringConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteVpcPeeringConnectionCommandError = async ( output , context ) : Promise < DeleteVpcPeeringConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeregisterGameServerCommand = async ( output , context ) : Promise < DeregisterGameServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeregisterGameServerCommandError ( output , context ) ; } await collectBody ( output . body , context ) ; const response = { $metadata : deserializeMetadata ( output ) , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeregisterGameServerCommandError = async ( output , context ) : Promise < DeregisterGameServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeAliasCommand = async ( output , context ) : Promise < DescribeAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAliasOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAliasCommandError = async ( output , context ) : Promise < DescribeAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeBuildCommand = async ( output , context ) : Promise < DescribeBuildCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeBuildCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeBuildOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeBuildCommandError = async ( output , context ) : Promise < DescribeBuildCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeEC2InstanceLimitsCommand = async ( output , context ) : Promise < DescribeEC2InstanceLimitsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeEC2InstanceLimitsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeEC2InstanceLimitsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeEC2InstanceLimitsCommandError = async ( output , context ) : Promise < DescribeEC2InstanceLimitsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetAttributesCommand = async ( output , context ) : Promise < DescribeFleetAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetAttributesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetAttributesCommandError = async ( output , context ) : Promise < DescribeFleetAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetCapacityCommand = async ( output , context ) : Promise < DescribeFleetCapacityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetCapacityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetCapacityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetCapacityCommandError = async ( output , context ) : Promise < DescribeFleetCapacityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetEventsCommand = async ( output , context ) : Promise < DescribeFleetEventsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetEventsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetEventsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetEventsCommandError = async ( output , context ) : Promise < DescribeFleetEventsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetLocationAttributesCommand = async ( output , context ) : Promise < DescribeFleetLocationAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetLocationAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetLocationAttributesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetLocationAttributesCommandError = async ( output , context ) : Promise < DescribeFleetLocationAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetLocationCapacityCommand = async ( output , context ) : Promise < DescribeFleetLocationCapacityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetLocationCapacityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetLocationCapacityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetLocationCapacityCommandError = async ( output , context ) : Promise < DescribeFleetLocationCapacityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetLocationUtilizationCommand = async ( output , context ) : Promise < DescribeFleetLocationUtilizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetLocationUtilizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetLocationUtilizationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetLocationUtilizationCommandError = async ( output , context ) : Promise < DescribeFleetLocationUtilizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetPortSettingsCommand = async ( output , context ) : Promise < DescribeFleetPortSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetPortSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetPortSettingsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetPortSettingsCommandError = async ( output , context ) : Promise < DescribeFleetPortSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeFleetUtilizationCommand = async ( output , context ) : Promise < DescribeFleetUtilizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeFleetUtilizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeFleetUtilizationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeFleetUtilizationCommandError = async ( output , context ) : Promise < DescribeFleetUtilizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameServerCommand = async ( output , context ) : Promise < DescribeGameServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameServerOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameServerCommandError = async ( output , context ) : Promise < DescribeGameServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameServerGroupCommand = async ( output , context ) : Promise < DescribeGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameServerGroupCommandError = async ( output , context ) : Promise < DescribeGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameServerInstancesCommand = async ( output , context ) : Promise < DescribeGameServerInstancesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameServerInstancesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameServerInstancesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameServerInstancesCommandError = async ( output , context ) : Promise < DescribeGameServerInstancesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameSessionDetailsCommand = async ( output , context ) : Promise < DescribeGameSessionDetailsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameSessionDetailsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameSessionDetailsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameSessionDetailsCommandError = async ( output , context ) : Promise < DescribeGameSessionDetailsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameSessionPlacementCommand = async ( output , context ) : Promise < DescribeGameSessionPlacementCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameSessionPlacementCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameSessionPlacementOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameSessionPlacementCommandError = async ( output , context ) : Promise < DescribeGameSessionPlacementCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameSessionQueuesCommand = async ( output , context ) : Promise < DescribeGameSessionQueuesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameSessionQueuesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameSessionQueuesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameSessionQueuesCommandError = async ( output , context ) : Promise < DescribeGameSessionQueuesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeGameSessionsCommand = async ( output , context ) : Promise < DescribeGameSessionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeGameSessionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeGameSessionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeGameSessionsCommandError = async ( output , context ) : Promise < DescribeGameSessionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeInstancesCommand = async ( output , context ) : Promise < DescribeInstancesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeInstancesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeInstancesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeInstancesCommandError = async ( output , context ) : Promise < DescribeInstancesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeMatchmakingCommand = async ( output , context ) : Promise < DescribeMatchmakingCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeMatchmakingCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeMatchmakingOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeMatchmakingCommandError = async ( output , context ) : Promise < DescribeMatchmakingCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeMatchmakingConfigurationsCommand = async ( output , context ) : Promise < DescribeMatchmakingConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeMatchmakingConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeMatchmakingConfigurationsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeMatchmakingConfigurationsCommandError = async ( output , context ) : Promise < DescribeMatchmakingConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeMatchmakingRuleSetsCommand = async ( output , context ) : Promise < DescribeMatchmakingRuleSetsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeMatchmakingRuleSetsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeMatchmakingRuleSetsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeMatchmakingRuleSetsCommandError = async ( output , context ) : Promise < DescribeMatchmakingRuleSetsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribePlayerSessionsCommand = async ( output , context ) : Promise < DescribePlayerSessionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribePlayerSessionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribePlayerSessionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribePlayerSessionsCommandError = async ( output , context ) : Promise < DescribePlayerSessionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeRuntimeConfigurationCommand = async ( output , context ) : Promise < DescribeRuntimeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeRuntimeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeRuntimeConfigurationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeRuntimeConfigurationCommandError = async ( output , context ) : Promise < DescribeRuntimeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeScalingPoliciesCommand = async ( output , context ) : Promise < DescribeScalingPoliciesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeScalingPoliciesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeScalingPoliciesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeScalingPoliciesCommandError = async ( output , context ) : Promise < DescribeScalingPoliciesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeScriptCommand = async ( output , context ) : Promise < DescribeScriptCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeScriptCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeScriptOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeScriptCommandError = async ( output , context ) : Promise < DescribeScriptCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommand = async ( output , context ) : Promise < DescribeVpcPeeringAuthorizationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeVpcPeeringAuthorizationsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeVpcPeeringAuthorizationsCommandError = async ( output , context ) : Promise < DescribeVpcPeeringAuthorizationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeVpcPeeringConnectionsCommand = async ( output , context ) : Promise < DescribeVpcPeeringConnectionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeVpcPeeringConnectionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeVpcPeeringConnectionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeVpcPeeringConnectionsCommandError = async ( output , context ) : Promise < DescribeVpcPeeringConnectionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetGameSessionLogUrlCommand = async ( output , context ) : Promise < GetGameSessionLogUrlCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetGameSessionLogUrlCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetGameSessionLogUrlOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetGameSessionLogUrlCommandError = async ( output , context ) : Promise < GetGameSessionLogUrlCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetInstanceAccessCommand = async ( output , context ) : Promise < GetInstanceAccessCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetInstanceAccessCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetInstanceAccessOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetInstanceAccessCommandError = async ( output , context ) : Promise < GetInstanceAccessCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAliasesCommand = async ( output , context ) : Promise < ListAliasesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAliasesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAliasesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAliasesCommandError = async ( output , context ) : Promise < ListAliasesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListBuildsCommand = async ( output , context ) : Promise < ListBuildsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListBuildsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListBuildsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListBuildsCommandError = async ( output , context ) : Promise < ListBuildsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListFleetsCommand = async ( output , context ) : Promise < ListFleetsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListFleetsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListFleetsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListFleetsCommandError = 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 "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListGameServerGroupsCommand = async ( output , context ) : Promise < ListGameServerGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListGameServerGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListGameServerGroupsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListGameServerGroupsCommandError = async ( output , context ) : Promise < ListGameServerGroupsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListGameServersCommand = async ( output , context ) : Promise < ListGameServersCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListGameServersCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListGameServersOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListGameServersCommandError = async ( output , context ) : Promise < ListGameServersCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListScriptsCommand = async ( output , context ) : Promise < ListScriptsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListScriptsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListScriptsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListScriptsCommandError = async ( output , context ) : Promise < ListScriptsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutScalingPolicyCommand = async ( output , context ) : Promise < PutScalingPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutScalingPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutScalingPolicyOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutScalingPolicyCommandError = async ( output , context ) : Promise < PutScalingPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1RegisterGameServerCommand = async ( output , context ) : Promise < RegisterGameServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RegisterGameServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RegisterGameServerOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RegisterGameServerCommandError = async ( output , context ) : Promise < RegisterGameServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1RequestUploadCredentialsCommand = async ( output , context ) : Promise < RequestUploadCredentialsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RequestUploadCredentialsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RequestUploadCredentialsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RequestUploadCredentialsCommandError = async ( output , context ) : Promise < RequestUploadCredentialsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ResolveAliasCommand = async ( output , context ) : Promise < ResolveAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ResolveAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ResolveAliasOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ResolveAliasCommandError = async ( output , context ) : Promise < ResolveAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ResumeGameServerGroupCommand = async ( output , context ) : Promise < ResumeGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ResumeGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ResumeGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ResumeGameServerGroupCommandError = async ( output , context ) : Promise < ResumeGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1SearchGameSessionsCommand = async ( output , context ) : Promise < SearchGameSessionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SearchGameSessionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SearchGameSessionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SearchGameSessionsCommandError = async ( output , context ) : Promise < SearchGameSessionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TerminalRoutingStrategyException" : case "com.amazonaws.gamelift#TerminalRoutingStrategyException" : response = { ... ( await deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartFleetActionsCommand = async ( output , context ) : Promise < StartFleetActionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartFleetActionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartFleetActionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartFleetActionsCommandError = async ( output , context ) : Promise < StartFleetActionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartGameSessionPlacementCommand = async ( output , context ) : Promise < StartGameSessionPlacementCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartGameSessionPlacementCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartGameSessionPlacementOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartGameSessionPlacementCommandError = async ( output , context ) : Promise < StartGameSessionPlacementCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartMatchBackfillCommand = async ( output , context ) : Promise < StartMatchBackfillCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartMatchBackfillCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartMatchBackfillOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartMatchBackfillCommandError = async ( output , context ) : Promise < StartMatchBackfillCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartMatchmakingCommand = async ( output , context ) : Promise < StartMatchmakingCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartMatchmakingCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartMatchmakingOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartMatchmakingCommandError = async ( output , context ) : Promise < StartMatchmakingCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StopFleetActionsCommand = async ( output , context ) : Promise < StopFleetActionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopFleetActionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopFleetActionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopFleetActionsCommandError = async ( output , context ) : Promise < StopFleetActionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StopGameSessionPlacementCommand = async ( output , context ) : Promise < StopGameSessionPlacementCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopGameSessionPlacementCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopGameSessionPlacementOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopGameSessionPlacementCommandError = async ( output , context ) : Promise < StopGameSessionPlacementCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StopMatchmakingCommand = async ( output , context ) : Promise < StopMatchmakingCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopMatchmakingCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopMatchmakingOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopMatchmakingCommandError = async ( output , context ) : Promise < StopMatchmakingCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1SuspendGameServerGroupCommand = async ( output , context ) : Promise < SuspendGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SuspendGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SuspendGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SuspendGameServerGroupCommandError = async ( output , context ) : Promise < SuspendGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UntagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TaggingFailedException" : case "com.amazonaws.gamelift#TaggingFailedException" : response = { ... ( await deserializeAws_json1_1TaggingFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateAliasCommand = async ( output , context ) : Promise < UpdateAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateAliasOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateAliasCommandError = async ( output , context ) : Promise < UpdateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateBuildCommand = async ( output , context ) : Promise < UpdateBuildCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateBuildCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateBuildOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateBuildCommandError = async ( output , context ) : Promise < UpdateBuildCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateFleetAttributesCommand = async ( output , context ) : Promise < UpdateFleetAttributesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateFleetAttributesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateFleetAttributesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateFleetAttributesCommandError = async ( output , context ) : Promise < UpdateFleetAttributesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateFleetCapacityCommand = async ( output , context ) : Promise < UpdateFleetCapacityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateFleetCapacityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateFleetCapacityOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateFleetCapacityCommandError = async ( output , context ) : Promise < UpdateFleetCapacityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateFleetPortSettingsCommand = async ( output , context ) : Promise < UpdateFleetPortSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateFleetPortSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateFleetPortSettingsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateFleetPortSettingsCommandError = async ( output , context ) : Promise < UpdateFleetPortSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.gamelift#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateGameServerCommand = async ( output , context ) : Promise < UpdateGameServerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateGameServerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateGameServerOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateGameServerCommandError = async ( output , context ) : Promise < UpdateGameServerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateGameServerGroupCommand = async ( output , context ) : Promise < UpdateGameServerGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateGameServerGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateGameServerGroupOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateGameServerGroupCommandError = async ( output , context ) : Promise < UpdateGameServerGroupCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateGameSessionCommand = async ( output , context ) : Promise < UpdateGameSessionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateGameSessionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateGameSessionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateGameSessionCommandError = async ( output , context ) : Promise < UpdateGameSessionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.gamelift#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidGameSessionStatusException" : case "com.amazonaws.gamelift#InvalidGameSessionStatusException" : response = { ... ( await deserializeAws_json1_1InvalidGameSessionStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateGameSessionQueueCommand = async ( output , context ) : Promise < UpdateGameSessionQueueCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateGameSessionQueueCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateGameSessionQueueOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateGameSessionQueueCommandError = async ( output , context ) : Promise < UpdateGameSessionQueueCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateMatchmakingConfigurationCommand = async ( output , context ) : Promise < UpdateMatchmakingConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateMatchmakingConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateMatchmakingConfigurationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateMatchmakingConfigurationCommandError = async ( output , context ) : Promise < UpdateMatchmakingConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateRuntimeConfigurationCommand = async ( output , context ) : Promise < UpdateRuntimeConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateRuntimeConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateRuntimeConfigurationOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateRuntimeConfigurationCommandError = async ( output , context ) : Promise < UpdateRuntimeConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidFleetStatusException" : case "com.amazonaws.gamelift#InvalidFleetStatusException" : response = { ... ( await deserializeAws_json1_1InvalidFleetStatusExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateScriptCommand = async ( output , context ) : Promise < UpdateScriptCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateScriptCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateScriptOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateScriptCommandError = async ( output , context ) : Promise < UpdateScriptCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NotFoundException" : case "com.amazonaws.gamelift#NotFoundException" : response = { ... ( await deserializeAws_json1_1NotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnauthorizedException" : case "com.amazonaws.gamelift#UnauthorizedException" : response = { ... ( await deserializeAws_json1_1UnauthorizedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ValidateMatchmakingRuleSetCommand = async ( output , context ) : Promise < ValidateMatchmakingRuleSetCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ValidateMatchmakingRuleSetCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ValidateMatchmakingRuleSetOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ValidateMatchmakingRuleSetCommandError = async ( output , context ) : Promise < ValidateMatchmakingRuleSetCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalServiceException" : case "com.amazonaws.gamelift#InternalServiceException" : response = { ... ( await deserializeAws_json1_1InternalServiceExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidRequestException" : case "com.amazonaws.gamelift#InvalidRequestException" : response = { ... ( await deserializeAws_json1_1InvalidRequestExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedRegionException" : case "com.amazonaws.gamelift#UnsupportedRegionException" : response = { ... ( await deserializeAws_json1_1UnsupportedRegionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_1ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConflictException ( body , context ) ; const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1FleetCapacityExceededExceptionResponse = async ( parsedOutput , context ) : Promise < FleetCapacityExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1FleetCapacityExceededException ( body , context ) ; const contents = { name : "FleetCapacityExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1GameSessionFullExceptionResponse = async ( parsedOutput , context ) : Promise < GameSessionFullException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1GameSessionFullException ( body , context ) ; const contents = { name : "GameSessionFullException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1IdempotentParameterMismatchExceptionResponse = async ( parsedOutput , context ) : Promise < IdempotentParameterMismatchException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1IdempotentParameterMismatchException ( body , context ) ; const contents = { name : "IdempotentParameterMismatchException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InternalServiceExceptionResponse = async ( parsedOutput , context ) : Promise < InternalServiceException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InternalServiceException ( body , context ) ; const contents = { name : "InternalServiceException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidFleetStatusExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidFleetStatusException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidFleetStatusException ( body , context ) ; const contents = { name : "InvalidFleetStatusException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidGameSessionStatusExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidGameSessionStatusException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidGameSessionStatusException ( body , context ) ; const contents = { name : "InvalidGameSessionStatusException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidRequestExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidRequestException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidRequestException ( body , context ) ; const contents = { name : "InvalidRequestException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LimitExceededException ( body , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1NotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < NotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1NotFoundException ( body , context ) ; const contents = { name : "NotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1OutOfCapacityExceptionResponse = async ( parsedOutput , context ) : Promise < OutOfCapacityException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1OutOfCapacityException ( body , context ) ; const contents = { name : "OutOfCapacityException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TaggingFailedExceptionResponse = async ( parsedOutput , context ) : Promise < TaggingFailedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TaggingFailedException ( body , context ) ; const contents = { name : "TaggingFailedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TerminalRoutingStrategyExceptionResponse = async ( parsedOutput , context ) : Promise < TerminalRoutingStrategyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TerminalRoutingStrategyException ( body , context ) ; const contents = { name : "TerminalRoutingStrategyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnauthorizedExceptionResponse = async ( parsedOutput , context ) : Promise < UnauthorizedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnauthorizedException ( body , context ) ; const contents = { name : "UnauthorizedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedRegionExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedRegionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedRegionException ( body , context ) ; const contents = { name : "UnsupportedRegionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AcceptMatchInput = ( input , context ) : any => { return { ... ( input . AcceptanceType !== undefined && input . AcceptanceType !== null && { AcceptanceType : input . AcceptanceType } ) , ... ( input . PlayerIds !== undefined && input . PlayerIds !== null && { PlayerIds : serializeAws_json1_1StringList ( input . PlayerIds , context ) } ) , ... ( input . TicketId !== undefined && input . TicketId !== null && { TicketId : input . TicketId } ) , } ; } ; const serializeAws_json1_1AttributeValue = ( input , context ) : any => { return { ... ( input . N !== undefined && input . N !== null && { N : __serializeFloat ( input . N ) } ) , ... ( input . S !== undefined && input . S !== null && { S : input . S } ) , ... ( input . SDM !== undefined && input . SDM !== null && { SDM : serializeAws_json1_1StringDoubleMap ( input . SDM , context ) } ) , ... ( input . SL !== undefined && input . SL !== null && { SL : serializeAws_json1_1StringList ( input . SL , context ) } ) , } ; } ; const serializeAws_json1_1CertificateConfiguration = ( input , context ) : any => { return { ... ( input . CertificateType !== undefined && input . CertificateType !== null && { CertificateType : input . CertificateType } ) , } ; } ; const serializeAws_json1_1ClaimGameServerInput = ( input , context ) : any => { return { ... ( input . GameServerData !== undefined && input . GameServerData !== null && { GameServerData : input . GameServerData } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerId !== undefined && input . GameServerId !== null && { GameServerId : input . GameServerId } ) , } ; } ; const serializeAws_json1_1CreateAliasInput = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . RoutingStrategy !== undefined && input . RoutingStrategy !== null && { RoutingStrategy : serializeAws_json1_1RoutingStrategy ( input . RoutingStrategy , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateBuildInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . OperatingSystem !== undefined && input . OperatingSystem !== null && { OperatingSystem : input . OperatingSystem } ) , ... ( input . StorageLocation !== undefined && input . StorageLocation !== null && { StorageLocation : serializeAws_json1_1S3Location ( input . StorageLocation , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1CreateFleetInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , ... ( input . CertificateConfiguration !== undefined && input . CertificateConfiguration !== null && { CertificateConfiguration : serializeAws_json1_1CertificateConfiguration ( input . CertificateConfiguration , context ) , } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . EC2InboundPermissions !== undefined && input . EC2InboundPermissions !== null && { EC2InboundPermissions : serializeAws_json1_1IpPermissionsList ( input . EC2InboundPermissions , context ) , } ) , ... ( input . EC2InstanceType !== undefined && input . EC2InstanceType !== null && { EC2InstanceType : input . EC2InstanceType } ) , ... ( input . FleetType !== undefined && input . FleetType !== null && { FleetType : input . FleetType } ) , ... ( input . InstanceRoleArn !== undefined && input . InstanceRoleArn !== null && { InstanceRoleArn : input . InstanceRoleArn } ) , ... ( input . Locations !== undefined && input . Locations !== null && { Locations : serializeAws_json1_1LocationConfigurationList ( input . Locations , context ) , } ) , ... ( input . LogPaths !== undefined && input . LogPaths !== null && { LogPaths : serializeAws_json1_1StringList ( input . LogPaths , context ) } ) , ... ( input . MetricGroups !== undefined && input . MetricGroups !== null && { MetricGroups : serializeAws_json1_1MetricGroupList ( input . MetricGroups , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NewGameSessionProtectionPolicy !== undefined && input . NewGameSessionProtectionPolicy !== null && { NewGameSessionProtectionPolicy : input . NewGameSessionProtectionPolicy , } ) , ... ( input . PeerVpcAwsAccountId !== undefined && input . PeerVpcAwsAccountId !== null && { PeerVpcAwsAccountId : input . PeerVpcAwsAccountId } ) , ... ( input . PeerVpcId !== undefined && input . PeerVpcId !== null && { PeerVpcId : input . PeerVpcId } ) , ... ( input . ResourceCreationLimitPolicy !== undefined && input . ResourceCreationLimitPolicy !== null && { ResourceCreationLimitPolicy : serializeAws_json1_1ResourceCreationLimitPolicy ( input . ResourceCreationLimitPolicy , context ) , } ) , ... ( input . RuntimeConfiguration !== undefined && input . RuntimeConfiguration !== null && { RuntimeConfiguration : serializeAws_json1_1RuntimeConfiguration ( input . RuntimeConfiguration , context ) , } ) , ... ( input . ScriptId !== undefined && input . ScriptId !== null && { ScriptId : input . ScriptId } ) , ... ( input . ServerLaunchParameters !== undefined && input . ServerLaunchParameters !== null && { ServerLaunchParameters : input . ServerLaunchParameters } ) , ... ( input . ServerLaunchPath !== undefined && input . ServerLaunchPath !== null && { ServerLaunchPath : input . ServerLaunchPath } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateFleetLocationsInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Locations !== undefined && input . Locations !== null && { Locations : serializeAws_json1_1LocationConfigurationList ( input . Locations , context ) , } ) , } ; } ; const serializeAws_json1_1CreateGameServerGroupInput = ( input , context ) : any => { return { ... ( input . AutoScalingPolicy !== undefined && input . AutoScalingPolicy !== null && { AutoScalingPolicy : serializeAws_json1_1GameServerGroupAutoScalingPolicy ( input . AutoScalingPolicy , context ) , } ) , ... ( input . BalancingStrategy !== undefined && input . BalancingStrategy !== null && { BalancingStrategy : input . BalancingStrategy } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerProtectionPolicy !== undefined && input . GameServerProtectionPolicy !== null && { GameServerProtectionPolicy : input . GameServerProtectionPolicy } ) , ... ( input . InstanceDefinitions !== undefined && input . InstanceDefinitions !== null && { InstanceDefinitions : serializeAws_json1_1InstanceDefinitions ( input . InstanceDefinitions , context ) , } ) , ... ( input . LaunchTemplate !== undefined && input . LaunchTemplate !== null && { LaunchTemplate : serializeAws_json1_1LaunchTemplateSpecification ( input . LaunchTemplate , context ) , } ) , ... ( input . MaxSize !== undefined && input . MaxSize !== null && { MaxSize : input . MaxSize } ) , ... ( input . MinSize !== undefined && input . MinSize !== null && { MinSize : input . MinSize } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . VpcSubnets !== undefined && input . VpcSubnets !== null && { VpcSubnets : serializeAws_json1_1VpcSubnets ( input . VpcSubnets , context ) } ) , } ; } ; const serializeAws_json1_1CreateGameSessionInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . CreatorId !== undefined && input . CreatorId !== null && { CreatorId : input . CreatorId } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . GameProperties !== undefined && input . GameProperties !== null && { GameProperties : serializeAws_json1_1GamePropertyList ( input . GameProperties , context ) , } ) , ... ( input . GameSessionData !== undefined && input . GameSessionData !== null && { GameSessionData : input . GameSessionData } ) , ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . IdempotencyToken !== undefined && input . IdempotencyToken !== null && { IdempotencyToken : input . IdempotencyToken } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . MaximumPlayerSessionCount !== undefined && input . MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount : input . MaximumPlayerSessionCount } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1CreateGameSessionQueueInput = ( input , context ) : any => { return { ... ( input . CustomEventData !== undefined && input . CustomEventData !== null && { CustomEventData : input . CustomEventData } ) , ... ( input . Destinations !== undefined && input . Destinations !== null && { Destinations : serializeAws_json1_1GameSessionQueueDestinationList ( input . Destinations , context ) , } ) , ... ( input . FilterConfiguration !== undefined && input . FilterConfiguration !== null && { FilterConfiguration : serializeAws_json1_1FilterConfiguration ( input . FilterConfiguration , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NotificationTarget !== undefined && input . NotificationTarget !== null && { NotificationTarget : input . NotificationTarget } ) , ... ( input . PlayerLatencyPolicies !== undefined && input . PlayerLatencyPolicies !== null && { PlayerLatencyPolicies : serializeAws_json1_1PlayerLatencyPolicyList ( input . PlayerLatencyPolicies , context ) , } ) , ... ( input . PriorityConfiguration !== undefined && input . PriorityConfiguration !== null && { PriorityConfiguration : serializeAws_json1_1PriorityConfiguration ( input . PriorityConfiguration , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . TimeoutInSeconds !== undefined && input . TimeoutInSeconds !== null && { TimeoutInSeconds : input . TimeoutInSeconds } ) , } ; } ; const serializeAws_json1_1CreateMatchmakingConfigurationInput = ( input , context ) : any => { return { ... ( input . AcceptanceRequired !== undefined && input . AcceptanceRequired !== null && { AcceptanceRequired : input . AcceptanceRequired } ) , ... ( input . AcceptanceTimeoutSeconds !== undefined && input . AcceptanceTimeoutSeconds !== null && { AcceptanceTimeoutSeconds : input . AcceptanceTimeoutSeconds } ) , ... ( input . AdditionalPlayerCount !== undefined && input . AdditionalPlayerCount !== null && { AdditionalPlayerCount : input . AdditionalPlayerCount } ) , ... ( input . BackfillMode !== undefined && input . BackfillMode !== null && { BackfillMode : input . BackfillMode } ) , ... ( input . CustomEventData !== undefined && input . CustomEventData !== null && { CustomEventData : input . CustomEventData } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . FlexMatchMode !== undefined && input . FlexMatchMode !== null && { FlexMatchMode : input . FlexMatchMode } ) , ... ( input . GameProperties !== undefined && input . GameProperties !== null && { GameProperties : serializeAws_json1_1GamePropertyList ( input . GameProperties , context ) , } ) , ... ( input . GameSessionData !== undefined && input . GameSessionData !== null && { GameSessionData : input . GameSessionData } ) , ... ( input . GameSessionQueueArns !== undefined && input . GameSessionQueueArns !== null && { GameSessionQueueArns : serializeAws_json1_1QueueArnsList ( input . GameSessionQueueArns , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NotificationTarget !== undefined && input . NotificationTarget !== null && { NotificationTarget : input . NotificationTarget } ) , ... ( input . RequestTimeoutSeconds !== undefined && input . RequestTimeoutSeconds !== null && { RequestTimeoutSeconds : input . RequestTimeoutSeconds } ) , ... ( input . RuleSetName !== undefined && input . RuleSetName !== null && { RuleSetName : input . RuleSetName } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateMatchmakingRuleSetInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . RuleSetBody !== undefined && input . RuleSetBody !== null && { RuleSetBody : input . RuleSetBody } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreatePlayerSessionInput = ( input , context ) : any => { return { ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . PlayerData !== undefined && input . PlayerData !== null && { PlayerData : input . PlayerData } ) , ... ( input . PlayerId !== undefined && input . PlayerId !== null && { PlayerId : input . PlayerId } ) , } ; } ; const serializeAws_json1_1CreatePlayerSessionsInput = ( input , context ) : any => { return { ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . PlayerDataMap !== undefined && input . PlayerDataMap !== null && { PlayerDataMap : serializeAws_json1_1PlayerDataMap ( input . PlayerDataMap , context ) , } ) , ... ( input . PlayerIds !== undefined && input . PlayerIds !== null && { PlayerIds : serializeAws_json1_1PlayerIdList ( input . PlayerIds , context ) } ) , } ; } ; const serializeAws_json1_1CreateScriptInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . StorageLocation !== undefined && input . StorageLocation !== null && { StorageLocation : serializeAws_json1_1S3Location ( input . StorageLocation , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , ... ( input . ZipFile !== undefined && input . ZipFile !== null && { ZipFile : context . base64Encoder ( input . ZipFile ) } ) , } ; } ; const serializeAws_json1_1CreateVpcPeeringAuthorizationInput = ( input , context ) : any => { return { ... ( input . GameLiftAwsAccountId !== undefined && input . GameLiftAwsAccountId !== null && { GameLiftAwsAccountId : input . GameLiftAwsAccountId } ) , ... ( input . PeerVpcId !== undefined && input . PeerVpcId !== null && { PeerVpcId : input . PeerVpcId } ) , } ; } ; const serializeAws_json1_1CreateVpcPeeringConnectionInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . PeerVpcAwsAccountId !== undefined && input . PeerVpcAwsAccountId !== null && { PeerVpcAwsAccountId : input . PeerVpcAwsAccountId } ) , ... ( input . PeerVpcId !== undefined && input . PeerVpcId !== null && { PeerVpcId : input . PeerVpcId } ) , } ; } ; const serializeAws_json1_1DeleteAliasInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , } ; } ; const serializeAws_json1_1DeleteBuildInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , } ; } ; const serializeAws_json1_1DeleteFleetInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , } ; } ; const serializeAws_json1_1DeleteFleetLocationsInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Locations !== undefined && input . Locations !== null && { Locations : serializeAws_json1_1LocationList ( input . Locations , context ) } ) , } ; } ; const serializeAws_json1_1DeleteGameServerGroupInput = ( input , context ) : any => { return { ... ( input . DeleteOption !== undefined && input . DeleteOption !== null && { DeleteOption : input . DeleteOption } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , } ; } ; const serializeAws_json1_1DeleteGameSessionQueueInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1DeleteMatchmakingConfigurationInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1DeleteMatchmakingRuleSetInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1DeleteScalingPolicyInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1DeleteScriptInput = ( input , context ) : any => { return { ... ( input . ScriptId !== undefined && input . ScriptId !== null && { ScriptId : input . ScriptId } ) , } ; } ; const serializeAws_json1_1DeleteVpcPeeringAuthorizationInput = ( input , context ) : any => { return { ... ( input . GameLiftAwsAccountId !== undefined && input . GameLiftAwsAccountId !== null && { GameLiftAwsAccountId : input . GameLiftAwsAccountId } ) , ... ( input . PeerVpcId !== undefined && input . PeerVpcId !== null && { PeerVpcId : input . PeerVpcId } ) , } ; } ; const serializeAws_json1_1DeleteVpcPeeringConnectionInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . VpcPeeringConnectionId !== undefined && input . VpcPeeringConnectionId !== null && { VpcPeeringConnectionId : input . VpcPeeringConnectionId } ) , } ; } ; const serializeAws_json1_1DeregisterGameServerInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerId !== undefined && input . GameServerId !== null && { GameServerId : input . GameServerId } ) , } ; } ; const serializeAws_json1_1DescribeAliasInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , } ; } ; const serializeAws_json1_1DescribeBuildInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , } ; } ; const serializeAws_json1_1DescribeEC2InstanceLimitsInput = ( input , context ) : any => { return { ... ( input . EC2InstanceType !== undefined && input . EC2InstanceType !== null && { EC2InstanceType : input . EC2InstanceType } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1DescribeFleetAttributesInput = ( input , context ) : any => { return { ... ( input . FleetIds !== undefined && input . FleetIds !== null && { FleetIds : serializeAws_json1_1FleetIdOrArnList ( input . FleetIds , context ) } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeFleetCapacityInput = ( input , context ) : any => { return { ... ( input . FleetIds !== undefined && input . FleetIds !== null && { FleetIds : serializeAws_json1_1FleetIdOrArnList ( input . FleetIds , context ) } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeFleetEventsInput = ( input , context ) : any => { return { ... ( input . EndTime !== undefined && input . EndTime !== null && { EndTime : Math . round ( input . EndTime . getTime ( ) / 1000 ) } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . StartTime !== undefined && input . StartTime !== null && { StartTime : Math . round ( input . StartTime . getTime ( ) / 1000 ) } ) , } ; } ; const serializeAws_json1_1DescribeFleetLocationAttributesInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Locations !== undefined && input . Locations !== null && { Locations : serializeAws_json1_1LocationList ( input . Locations , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeFleetLocationCapacityInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1DescribeFleetLocationUtilizationInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1DescribeFleetPortSettingsInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1DescribeFleetUtilizationInput = ( input , context ) : any => { return { ... ( input . FleetIds !== undefined && input . FleetIds !== null && { FleetIds : serializeAws_json1_1FleetIdOrArnList ( input . FleetIds , context ) } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeGameServerGroupInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , } ; } ; const serializeAws_json1_1DescribeGameServerInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerId !== undefined && input . GameServerId !== null && { GameServerId : input . GameServerId } ) , } ; } ; const serializeAws_json1_1DescribeGameServerInstancesInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . InstanceIds !== undefined && input . InstanceIds !== null && { InstanceIds : serializeAws_json1_1GameServerInstanceIds ( input . InstanceIds , context ) , } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeGameSessionDetailsInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . StatusFilter !== undefined && input . StatusFilter !== null && { StatusFilter : input . StatusFilter } ) , } ; } ; const serializeAws_json1_1DescribeGameSessionPlacementInput = ( input , context ) : any => { return { ... ( input . PlacementId !== undefined && input . PlacementId !== null && { PlacementId : input . PlacementId } ) , } ; } ; const serializeAws_json1_1DescribeGameSessionQueuesInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Names !== undefined && input . Names !== null && { Names : serializeAws_json1_1GameSessionQueueNameOrArnList ( input . Names , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeGameSessionsInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . StatusFilter !== undefined && input . StatusFilter !== null && { StatusFilter : input . StatusFilter } ) , } ; } ; const serializeAws_json1_1DescribeInstancesInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . InstanceId !== undefined && input . InstanceId !== null && { InstanceId : input . InstanceId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeMatchmakingConfigurationsInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Names !== undefined && input . Names !== null && { Names : serializeAws_json1_1MatchmakingConfigurationNameList ( input . Names , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . RuleSetName !== undefined && input . RuleSetName !== null && { RuleSetName : input . RuleSetName } ) , } ; } ; const serializeAws_json1_1DescribeMatchmakingInput = ( input , context ) : any => { return { ... ( input . TicketIds !== undefined && input . TicketIds !== null && { TicketIds : serializeAws_json1_1MatchmakingIdList ( input . TicketIds , context ) } ) , } ; } ; const serializeAws_json1_1DescribeMatchmakingRuleSetsInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Names !== undefined && input . Names !== null && { Names : serializeAws_json1_1MatchmakingRuleSetNameList ( input . Names , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribePlayerSessionsInput = ( input , context ) : any => { return { ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . PlayerId !== undefined && input . PlayerId !== null && { PlayerId : input . PlayerId } ) , ... ( input . PlayerSessionId !== undefined && input . PlayerSessionId !== null && { PlayerSessionId : input . PlayerSessionId } ) , ... ( input . PlayerSessionStatusFilter !== undefined && input . PlayerSessionStatusFilter !== null && { PlayerSessionStatusFilter : input . PlayerSessionStatusFilter } ) , } ; } ; const serializeAws_json1_1DescribeRuntimeConfigurationInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , } ; } ; const serializeAws_json1_1DescribeScalingPoliciesInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . StatusFilter !== undefined && input . StatusFilter !== null && { StatusFilter : input . StatusFilter } ) , } ; } ; const serializeAws_json1_1DescribeScriptInput = ( input , context ) : any => { return { ... ( input . ScriptId !== undefined && input . ScriptId !== null && { ScriptId : input . ScriptId } ) , } ; } ; const serializeAws_json1_1DescribeVpcPeeringAuthorizationsInput = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1DescribeVpcPeeringConnectionsInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , } ; } ; const serializeAws_json1_1DesiredPlayerSession = ( input , context ) : any => { return { ... ( input . PlayerData !== undefined && input . PlayerData !== null && { PlayerData : input . PlayerData } ) , ... ( input . PlayerId !== undefined && input . PlayerId !== null && { PlayerId : input . PlayerId } ) , } ; } ; const serializeAws_json1_1DesiredPlayerSessionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1DesiredPlayerSession ( entry , context ) ; } ) ; } ; const serializeAws_json1_1FilterConfiguration = ( input , context ) : any => { return { ... ( input . AllowedLocations !== undefined && input . AllowedLocations !== null && { AllowedLocations : serializeAws_json1_1LocationList ( input . AllowedLocations , context ) , } ) , } ; } ; const serializeAws_json1_1FleetActionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1FleetIdOrArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GameProperty = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1GamePropertyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1GameProperty ( entry , context ) ; } ) ; } ; const serializeAws_json1_1GameServerGroupActions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GameServerGroupAutoScalingPolicy = ( input , context ) : any => { return { ... ( input . EstimatedInstanceWarmup !== undefined && input . EstimatedInstanceWarmup !== null && { EstimatedInstanceWarmup : input . EstimatedInstanceWarmup } ) , ... ( input . TargetTrackingConfiguration !== undefined && input . TargetTrackingConfiguration !== null && { TargetTrackingConfiguration : serializeAws_json1_1TargetTrackingConfiguration ( input . TargetTrackingConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_1GameServerInstanceIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GameSessionQueueDestination = ( input , context ) : any => { return { ... ( input . DestinationArn !== undefined && input . DestinationArn !== null && { DestinationArn : input . DestinationArn } ) , } ; } ; const serializeAws_json1_1GameSessionQueueDestinationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1GameSessionQueueDestination ( entry , context ) ; } ) ; } ; const serializeAws_json1_1GameSessionQueueNameOrArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GetGameSessionLogUrlInput = ( input , context ) : any => { return { ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , } ; } ; const serializeAws_json1_1GetInstanceAccessInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . InstanceId !== undefined && input . InstanceId !== null && { InstanceId : input . InstanceId } ) , } ; } ; const serializeAws_json1_1InstanceDefinition = ( input , context ) : any => { return { ... ( input . InstanceType !== undefined && input . InstanceType !== null && { InstanceType : input . InstanceType } ) , ... ( input . WeightedCapacity !== undefined && input . WeightedCapacity !== null && { WeightedCapacity : input . WeightedCapacity } ) , } ; } ; const serializeAws_json1_1InstanceDefinitions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1InstanceDefinition ( entry , context ) ; } ) ; } ; const serializeAws_json1_1IpPermission = ( input , context ) : any => { return { ... ( input . FromPort !== undefined && input . FromPort !== null && { FromPort : input . FromPort } ) , ... ( input . IpRange !== undefined && input . IpRange !== null && { IpRange : input . IpRange } ) , ... ( input . Protocol !== undefined && input . Protocol !== null && { Protocol : input . Protocol } ) , ... ( input . ToPort !== undefined && input . ToPort !== null && { ToPort : input . ToPort } ) , } ; } ; const serializeAws_json1_1IpPermissionsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1IpPermission ( entry , context ) ; } ) ; } ; const serializeAws_json1_1LatencyMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1LaunchTemplateSpecification = ( input , context ) : any => { return { ... ( input . LaunchTemplateId !== undefined && input . LaunchTemplateId !== null && { LaunchTemplateId : input . LaunchTemplateId } ) , ... ( input . LaunchTemplateName !== undefined && input . LaunchTemplateName !== null && { LaunchTemplateName : input . LaunchTemplateName } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1ListAliasesInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . RoutingStrategyType !== undefined && input . RoutingStrategyType !== null && { RoutingStrategyType : input . RoutingStrategyType } ) , } ; } ; const serializeAws_json1_1ListBuildsInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , } ; } ; const serializeAws_json1_1ListFleetsInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ScriptId !== undefined && input . ScriptId !== null && { ScriptId : input . ScriptId } ) , } ; } ; const serializeAws_json1_1ListGameServerGroupsInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListGameServersInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . SortOrder !== undefined && input . SortOrder !== null && { SortOrder : input . SortOrder } ) , } ; } ; const serializeAws_json1_1ListScriptsInput = ( input , context ) : any => { return { ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceARN !== undefined && input . ResourceARN !== null && { ResourceARN : input . ResourceARN } ) , } ; } ; const serializeAws_json1_1LocationConfiguration = ( input , context ) : any => { return { ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1LocationConfigurationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1LocationConfiguration ( entry , context ) ; } ) ; } ; const serializeAws_json1_1LocationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MatchmakingConfigurationNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MatchmakingIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MatchmakingRuleSetNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MetricGroupList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1Player = ( input , context ) : any => { return { ... ( input . LatencyInMs !== undefined && input . LatencyInMs !== null && { LatencyInMs : serializeAws_json1_1LatencyMap ( input . LatencyInMs , context ) } ) , ... ( input . PlayerAttributes !== undefined && input . PlayerAttributes !== null && { PlayerAttributes : serializeAws_json1_1PlayerAttributeMap ( input . PlayerAttributes , context ) , } ) , ... ( input . PlayerId !== undefined && input . PlayerId !== null && { PlayerId : input . PlayerId } ) , ... ( input . Team !== undefined && input . Team !== null && { Team : input . Team } ) , } ; } ; const serializeAws_json1_1PlayerAttributeMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_json1_1AttributeValue ( value , context ) , } ; } , { } ) ; } ; const serializeAws_json1_1PlayerDataMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1PlayerIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PlayerLatency = ( input , context ) : any => { return { ... ( input . LatencyInMilliseconds !== undefined && input . LatencyInMilliseconds !== null && { LatencyInMilliseconds : __serializeFloat ( input . LatencyInMilliseconds ) } ) , ... ( input . PlayerId !== undefined && input . PlayerId !== null && { PlayerId : input . PlayerId } ) , ... ( input . RegionIdentifier !== undefined && input . RegionIdentifier !== null && { RegionIdentifier : input . RegionIdentifier } ) , } ; } ; const serializeAws_json1_1PlayerLatencyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1PlayerLatency ( entry , context ) ; } ) ; } ; const serializeAws_json1_1PlayerLatencyPolicy = ( input , context ) : any => { return { ... ( input . MaximumIndividualPlayerLatencyMilliseconds !== undefined && input . MaximumIndividualPlayerLatencyMilliseconds !== null && { MaximumIndividualPlayerLatencyMilliseconds : input . MaximumIndividualPlayerLatencyMilliseconds , } ) , ... ( input . PolicyDurationSeconds !== undefined && input . PolicyDurationSeconds !== null && { PolicyDurationSeconds : input . PolicyDurationSeconds } ) , } ; } ; const serializeAws_json1_1PlayerLatencyPolicyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1PlayerLatencyPolicy ( entry , context ) ; } ) ; } ; const serializeAws_json1_1PlayerList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Player ( entry , context ) ; } ) ; } ; const serializeAws_json1_1PriorityConfiguration = ( input , context ) : any => { return { ... ( input . LocationOrder !== undefined && input . LocationOrder !== null && { LocationOrder : serializeAws_json1_1LocationList ( input . LocationOrder , context ) , } ) , ... ( input . PriorityOrder !== undefined && input . PriorityOrder !== null && { PriorityOrder : serializeAws_json1_1PriorityTypeList ( input . PriorityOrder , context ) , } ) , } ; } ; const serializeAws_json1_1PriorityTypeList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PutScalingPolicyInput = ( input , context ) : any => { return { ... ( input . ComparisonOperator !== undefined && input . ComparisonOperator !== null && { ComparisonOperator : input . ComparisonOperator } ) , ... ( input . EvaluationPeriods !== undefined && input . EvaluationPeriods !== null && { EvaluationPeriods : input . EvaluationPeriods } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . MetricName !== undefined && input . MetricName !== null && { MetricName : input . MetricName } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . PolicyType !== undefined && input . PolicyType !== null && { PolicyType : input . PolicyType } ) , ... ( input . ScalingAdjustment !== undefined && input . ScalingAdjustment !== null && { ScalingAdjustment : input . ScalingAdjustment } ) , ... ( input . ScalingAdjustmentType !== undefined && input . ScalingAdjustmentType !== null && { ScalingAdjustmentType : input . ScalingAdjustmentType } ) , ... ( input . TargetConfiguration !== undefined && input . TargetConfiguration !== null && { TargetConfiguration : serializeAws_json1_1TargetConfiguration ( input . TargetConfiguration , context ) , } ) , ... ( input . Threshold !== undefined && input . Threshold !== null && { Threshold : __serializeFloat ( input . Threshold ) } ) , } ; } ; const serializeAws_json1_1QueueArnsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1RegisterGameServerInput = ( input , context ) : any => { return { ... ( input . ConnectionInfo !== undefined && input . ConnectionInfo !== null && { ConnectionInfo : input . ConnectionInfo } ) , ... ( input . GameServerData !== undefined && input . GameServerData !== null && { GameServerData : input . GameServerData } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerId !== undefined && input . GameServerId !== null && { GameServerId : input . GameServerId } ) , ... ( input . InstanceId !== undefined && input . InstanceId !== null && { InstanceId : input . InstanceId } ) , } ; } ; const serializeAws_json1_1RequestUploadCredentialsInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , } ; } ; const serializeAws_json1_1ResolveAliasInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , } ; } ; const serializeAws_json1_1ResourceCreationLimitPolicy = ( input , context ) : any => { return { ... ( input . NewGameSessionsPerCreator !== undefined && input . NewGameSessionsPerCreator !== null && { NewGameSessionsPerCreator : input . NewGameSessionsPerCreator } ) , ... ( input . PolicyPeriodInMinutes !== undefined && input . PolicyPeriodInMinutes !== null && { PolicyPeriodInMinutes : input . PolicyPeriodInMinutes } ) , } ; } ; const serializeAws_json1_1ResumeGameServerGroupInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . ResumeActions !== undefined && input . ResumeActions !== null && { ResumeActions : serializeAws_json1_1GameServerGroupActions ( input . ResumeActions , context ) , } ) , } ; } ; const serializeAws_json1_1RoutingStrategy = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Message !== undefined && input . Message !== null && { Message : input . Message } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_1RuntimeConfiguration = ( input , context ) : any => { return { ... ( input . GameSessionActivationTimeoutSeconds !== undefined && input . GameSessionActivationTimeoutSeconds !== null && { GameSessionActivationTimeoutSeconds : input . GameSessionActivationTimeoutSeconds , } ) , ... ( input . MaxConcurrentGameSessionActivations !== undefined && input . MaxConcurrentGameSessionActivations !== null && { MaxConcurrentGameSessionActivations : input . MaxConcurrentGameSessionActivations , } ) , ... ( input . ServerProcesses !== undefined && input . ServerProcesses !== null && { ServerProcesses : serializeAws_json1_1ServerProcessList ( input . ServerProcesses , context ) , } ) , } ; } ; const serializeAws_json1_1S3Location = ( input , context ) : any => { return { ... ( input . Bucket !== undefined && input . Bucket !== null && { Bucket : input . Bucket } ) , ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . ObjectVersion !== undefined && input . ObjectVersion !== null && { ObjectVersion : input . ObjectVersion } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , } ; } ; const serializeAws_json1_1SearchGameSessionsInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . FilterExpression !== undefined && input . FilterExpression !== null && { FilterExpression : input . FilterExpression } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . SortExpression !== undefined && input . SortExpression !== null && { SortExpression : input . SortExpression } ) , } ; } ; const serializeAws_json1_1ServerProcess = ( input , context ) : any => { return { ... ( input . ConcurrentExecutions !== undefined && input . ConcurrentExecutions !== null && { ConcurrentExecutions : input . ConcurrentExecutions } ) , ... ( input . LaunchPath !== undefined && input . LaunchPath !== null && { LaunchPath : input . LaunchPath } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : input . Parameters } ) , } ; } ; const serializeAws_json1_1ServerProcessList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ServerProcess ( entry , context ) ; } ) ; } ; const serializeAws_json1_1StartFleetActionsInput = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_json1_1FleetActionList ( input . Actions , context ) } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1StartGameSessionPlacementInput = ( input , context ) : any => { return { ... ( input . DesiredPlayerSessions !== undefined && input . DesiredPlayerSessions !== null && { DesiredPlayerSessions : serializeAws_json1_1DesiredPlayerSessionList ( input . DesiredPlayerSessions , context ) , } ) , ... ( input . GameProperties !== undefined && input . GameProperties !== null && { GameProperties : serializeAws_json1_1GamePropertyList ( input . GameProperties , context ) , } ) , ... ( input . GameSessionData !== undefined && input . GameSessionData !== null && { GameSessionData : input . GameSessionData } ) , ... ( input . GameSessionName !== undefined && input . GameSessionName !== null && { GameSessionName : input . GameSessionName } ) , ... ( input . GameSessionQueueName !== undefined && input . GameSessionQueueName !== null && { GameSessionQueueName : input . GameSessionQueueName } ) , ... ( input . MaximumPlayerSessionCount !== undefined && input . MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount : input . MaximumPlayerSessionCount } ) , ... ( input . PlacementId !== undefined && input . PlacementId !== null && { PlacementId : input . PlacementId } ) , ... ( input . PlayerLatencies !== undefined && input . PlayerLatencies !== null && { PlayerLatencies : serializeAws_json1_1PlayerLatencyList ( input . PlayerLatencies , context ) , } ) , } ; } ; const serializeAws_json1_1StartMatchBackfillInput = ( input , context ) : any => { return { ... ( input . ConfigurationName !== undefined && input . ConfigurationName !== null && { ConfigurationName : input . ConfigurationName } ) , ... ( input . GameSessionArn !== undefined && input . GameSessionArn !== null && { GameSessionArn : input . GameSessionArn } ) , ... ( input . Players !== undefined && input . Players !== null && { Players : serializeAws_json1_1PlayerList ( input . Players , context ) } ) , ... ( input . TicketId !== undefined && input . TicketId !== null && { TicketId : input . TicketId } ) , } ; } ; const serializeAws_json1_1StartMatchmakingInput = ( input , context ) : any => { return { ... ( input . ConfigurationName !== undefined && input . ConfigurationName !== null && { ConfigurationName : input . ConfigurationName } ) , ... ( input . Players !== undefined && input . Players !== null && { Players : serializeAws_json1_1PlayerList ( input . Players , context ) } ) , ... ( input . TicketId !== undefined && input . TicketId !== null && { TicketId : input . TicketId } ) , } ; } ; const serializeAws_json1_1StopFleetActionsInput = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_json1_1FleetActionList ( input . Actions , context ) } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , } ; } ; const serializeAws_json1_1StopGameSessionPlacementInput = ( input , context ) : any => { return { ... ( input . PlacementId !== undefined && input . PlacementId !== null && { PlacementId : input . PlacementId } ) , } ; } ; const serializeAws_json1_1StopMatchmakingInput = ( input , context ) : any => { return { ... ( input . TicketId !== undefined && input . TicketId !== null && { TicketId : input . TicketId } ) , } ; } ; const serializeAws_json1_1StringDoubleMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __serializeFloat ( value ) , } ; } , { } ) ; } ; const serializeAws_json1_1StringList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1SuspendGameServerGroupInput = ( input , context ) : any => { return { ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . SuspendActions !== undefined && input . SuspendActions !== null && { SuspendActions : serializeAws_json1_1GameServerGroupActions ( input . SuspendActions , context ) , } ) , } ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceARN !== undefined && input . ResourceARN !== null && { ResourceARN : input . ResourceARN } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1TargetConfiguration = ( input , context ) : any => { return { ... ( input . TargetValue !== undefined && input . TargetValue !== null && { TargetValue : __serializeFloat ( input . TargetValue ) } ) , } ; } ; const serializeAws_json1_1TargetTrackingConfiguration = ( input , context ) : any => { return { ... ( input . TargetValue !== undefined && input . TargetValue !== null && { TargetValue : __serializeFloat ( input . TargetValue ) } ) , } ; } ; const serializeAws_json1_1UntagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceARN !== undefined && input . ResourceARN !== null && { ResourceARN : input . ResourceARN } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_1TagKeyList ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_1UpdateAliasInput = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . RoutingStrategy !== undefined && input . RoutingStrategy !== null && { RoutingStrategy : serializeAws_json1_1RoutingStrategy ( input . RoutingStrategy , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateBuildInput = ( input , context ) : any => { return { ... ( input . BuildId !== undefined && input . BuildId !== null && { BuildId : input . BuildId } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1UpdateFleetAttributesInput = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . MetricGroups !== undefined && input . MetricGroups !== null && { MetricGroups : serializeAws_json1_1MetricGroupList ( input . MetricGroups , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NewGameSessionProtectionPolicy !== undefined && input . NewGameSessionProtectionPolicy !== null && { NewGameSessionProtectionPolicy : input . NewGameSessionProtectionPolicy , } ) , ... ( input . ResourceCreationLimitPolicy !== undefined && input . ResourceCreationLimitPolicy !== null && { ResourceCreationLimitPolicy : serializeAws_json1_1ResourceCreationLimitPolicy ( input . ResourceCreationLimitPolicy , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateFleetCapacityInput = ( input , context ) : any => { return { ... ( input . DesiredInstances !== undefined && input . DesiredInstances !== null && { DesiredInstances : input . DesiredInstances } ) , ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . Location !== undefined && input . Location !== null && { Location : input . Location } ) , ... ( input . MaxSize !== undefined && input . MaxSize !== null && { MaxSize : input . MaxSize } ) , ... ( input . MinSize !== undefined && input . MinSize !== null && { MinSize : input . MinSize } ) , } ; } ; const serializeAws_json1_1UpdateFleetPortSettingsInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . InboundPermissionAuthorizations !== undefined && input . InboundPermissionAuthorizations !== null && { InboundPermissionAuthorizations : serializeAws_json1_1IpPermissionsList ( input . InboundPermissionAuthorizations , context ) , } ) , ... ( input . InboundPermissionRevocations !== undefined && input . InboundPermissionRevocations !== null && { InboundPermissionRevocations : serializeAws_json1_1IpPermissionsList ( input . InboundPermissionRevocations , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateGameServerGroupInput = ( input , context ) : any => { return { ... ( input . BalancingStrategy !== undefined && input . BalancingStrategy !== null && { BalancingStrategy : input . BalancingStrategy } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerProtectionPolicy !== undefined && input . GameServerProtectionPolicy !== null && { GameServerProtectionPolicy : input . GameServerProtectionPolicy } ) , ... ( input . InstanceDefinitions !== undefined && input . InstanceDefinitions !== null && { InstanceDefinitions : serializeAws_json1_1InstanceDefinitions ( input . InstanceDefinitions , context ) , } ) , ... ( input . RoleArn !== undefined && input . RoleArn !== null && { RoleArn : input . RoleArn } ) , } ; } ; const serializeAws_json1_1UpdateGameServerInput = ( input , context ) : any => { return { ... ( input . GameServerData !== undefined && input . GameServerData !== null && { GameServerData : input . GameServerData } ) , ... ( input . GameServerGroupName !== undefined && input . GameServerGroupName !== null && { GameServerGroupName : input . GameServerGroupName } ) , ... ( input . GameServerId !== undefined && input . GameServerId !== null && { GameServerId : input . GameServerId } ) , ... ( input . HealthCheck !== undefined && input . HealthCheck !== null && { HealthCheck : input . HealthCheck } ) , ... ( input . UtilizationStatus !== undefined && input . UtilizationStatus !== null && { UtilizationStatus : input . UtilizationStatus } ) , } ; } ; const serializeAws_json1_1UpdateGameSessionInput = ( input , context ) : any => { return { ... ( input . GameSessionId !== undefined && input . GameSessionId !== null && { GameSessionId : input . GameSessionId } ) , ... ( input . MaximumPlayerSessionCount !== undefined && input . MaximumPlayerSessionCount !== null && { MaximumPlayerSessionCount : input . MaximumPlayerSessionCount } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . PlayerSessionCreationPolicy !== undefined && input . PlayerSessionCreationPolicy !== null && { PlayerSessionCreationPolicy : input . PlayerSessionCreationPolicy } ) , ... ( input . ProtectionPolicy !== undefined && input . ProtectionPolicy !== null && { ProtectionPolicy : input . ProtectionPolicy } ) , } ; } ; const serializeAws_json1_1UpdateGameSessionQueueInput = ( input , context ) : any => { return { ... ( input . CustomEventData !== undefined && input . CustomEventData !== null && { CustomEventData : input . CustomEventData } ) , ... ( input . Destinations !== undefined && input . Destinations !== null && { Destinations : serializeAws_json1_1GameSessionQueueDestinationList ( input . Destinations , context ) , } ) , ... ( input . FilterConfiguration !== undefined && input . FilterConfiguration !== null && { FilterConfiguration : serializeAws_json1_1FilterConfiguration ( input . FilterConfiguration , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NotificationTarget !== undefined && input . NotificationTarget !== null && { NotificationTarget : input . NotificationTarget } ) , ... ( input . PlayerLatencyPolicies !== undefined && input . PlayerLatencyPolicies !== null && { PlayerLatencyPolicies : serializeAws_json1_1PlayerLatencyPolicyList ( input . PlayerLatencyPolicies , context ) , } ) , ... ( input . PriorityConfiguration !== undefined && input . PriorityConfiguration !== null && { PriorityConfiguration : serializeAws_json1_1PriorityConfiguration ( input . PriorityConfiguration , context ) , } ) , ... ( input . TimeoutInSeconds !== undefined && input . TimeoutInSeconds !== null && { TimeoutInSeconds : input . TimeoutInSeconds } ) , } ; } ; const serializeAws_json1_1UpdateMatchmakingConfigurationInput = ( input , context ) : any => { return { ... ( input . AcceptanceRequired !== undefined && input . AcceptanceRequired !== null && { AcceptanceRequired : input . AcceptanceRequired } ) , ... ( input . AcceptanceTimeoutSeconds !== undefined && input . AcceptanceTimeoutSeconds !== null && { AcceptanceTimeoutSeconds : input . AcceptanceTimeoutSeconds } ) , ... ( input . AdditionalPlayerCount !== undefined && input . AdditionalPlayerCount !== null && { AdditionalPlayerCount : input . AdditionalPlayerCount } ) , ... ( input . BackfillMode !== undefined && input . BackfillMode !== null && { BackfillMode : input . BackfillMode } ) , ... ( input . CustomEventData !== undefined && input . CustomEventData !== null && { CustomEventData : input . CustomEventData } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . FlexMatchMode !== undefined && input . FlexMatchMode !== null && { FlexMatchMode : input . FlexMatchMode } ) , ... ( input . GameProperties !== undefined && input . GameProperties !== null && { GameProperties : serializeAws_json1_1GamePropertyList ( input . GameProperties , context ) , } ) , ... ( input . GameSessionData !== undefined && input . GameSessionData !== null && { GameSessionData : input . GameSessionData } ) , ... ( input . GameSessionQueueArns !== undefined && input . GameSessionQueueArns !== null && { GameSessionQueueArns : serializeAws_json1_1QueueArnsList ( input . GameSessionQueueArns , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . NotificationTarget !== undefined && input . NotificationTarget !== null && { NotificationTarget : input . NotificationTarget } ) , ... ( input . RequestTimeoutSeconds !== undefined && input . RequestTimeoutSeconds !== null && { RequestTimeoutSeconds : input . RequestTimeoutSeconds } ) , ... ( input . RuleSetName !== undefined && input . RuleSetName !== null && { RuleSetName : input . RuleSetName } ) , } ; } ; const serializeAws_json1_1UpdateRuntimeConfigurationInput = ( input , context ) : any => { return { ... ( input . FleetId !== undefined && input . FleetId !== null && { FleetId : input . FleetId } ) , ... ( input . RuntimeConfiguration !== undefined && input . RuntimeConfiguration !== null && { RuntimeConfiguration : serializeAws_json1_1RuntimeConfiguration ( input . RuntimeConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateScriptInput = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . ScriptId !== undefined && input . ScriptId !== null && { ScriptId : input . ScriptId } ) , ... ( input . StorageLocation !== undefined && input . StorageLocation !== null && { StorageLocation : serializeAws_json1_1S3Location ( input . StorageLocation , context ) , } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , ... ( input . ZipFile !== undefined && input . ZipFile !== null && { ZipFile : context . base64Encoder ( input . ZipFile ) } ) , } ; } ; const serializeAws_json1_1ValidateMatchmakingRuleSetInput = ( input , context ) : any => { return { ... ( input . RuleSetBody !== undefined && input . RuleSetBody !== null && { RuleSetBody : input . RuleSetBody } ) , } ; } ; const serializeAws_json1_1VpcSubnets = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const deserializeAws_json1_1AcceptMatchOutput = ( output , context ) : AcceptMatchOutput => { return { } as any ; } ; const deserializeAws_json1_1Alias = ( output , context ) : Alias => { return { AliasArn : __expectString ( output . AliasArn ) , AliasId : __expectString ( output . AliasId ) , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , Description : __expectString ( output . Description ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , RoutingStrategy : output . RoutingStrategy !== undefined && output . RoutingStrategy !== null ? deserializeAws_json1_1RoutingStrategy ( output . RoutingStrategy , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AliasList = ( output , context ) : Alias [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Alias ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AttributeValue = ( output , context ) : AttributeValue => { return { N : __limitedParseDouble ( output . N ) , S : __expectString ( output . S ) , SDM : output . SDM !== undefined && output . SDM !== null ? deserializeAws_json1_1StringDoubleMap ( output . SDM , context ) : undefined , SL : output . SL !== undefined && output . SL !== null ? deserializeAws_json1_1StringList ( output . SL , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AwsCredentials = ( output , context ) : AwsCredentials => { return { AccessKeyId : __expectString ( output . AccessKeyId ) , SecretAccessKey : __expectString ( output . SecretAccessKey ) , SessionToken : __expectString ( output . SessionToken ) , } as any ; } ; const deserializeAws_json1_1Build = ( output , context ) : Build => { return { BuildArn : __expectString ( output . BuildArn ) , BuildId : __expectString ( output . BuildId ) , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , Name : __expectString ( output . Name ) , OperatingSystem : __expectString ( output . OperatingSystem ) , SizeOnDisk : __expectLong ( output . SizeOnDisk ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1BuildList = ( output , context ) : Build [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Build ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CertificateConfiguration = ( output , context ) : CertificateConfiguration => { return { CertificateType : __expectString ( output . CertificateType ) , } as any ; } ; const deserializeAws_json1_1ClaimGameServerOutput = ( output , context ) : ClaimGameServerOutput => { return { GameServer : output . GameServer !== undefined && output . GameServer !== null ? deserializeAws_json1_1GameServer ( output . GameServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ConflictException = ( output , context ) : ConflictException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1CreateAliasOutput = ( output , context ) : CreateAliasOutput => { return { Alias : output . Alias !== undefined && output . Alias !== null ? deserializeAws_json1_1Alias ( output . Alias , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateBuildOutput = ( output , context ) : CreateBuildOutput => { return { Build : output . Build !== undefined && output . Build !== null ? deserializeAws_json1_1Build ( output . Build , context ) : undefined , StorageLocation : output . StorageLocation !== undefined && output . StorageLocation !== null ? deserializeAws_json1_1S3Location ( output . StorageLocation , context ) : undefined , UploadCredentials : output . UploadCredentials !== undefined && output . UploadCredentials !== null ? deserializeAws_json1_1AwsCredentials ( output . UploadCredentials , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateFleetLocationsOutput = ( output , context ) : CreateFleetLocationsOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , LocationStates : output . LocationStates !== undefined && output . LocationStates !== null ? deserializeAws_json1_1LocationStateList ( output . LocationStates , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateFleetOutput = ( output , context ) : CreateFleetOutput => { return { FleetAttributes : output . FleetAttributes !== undefined && output . FleetAttributes !== null ? deserializeAws_json1_1FleetAttributes ( output . FleetAttributes , context ) : undefined , LocationStates : output . LocationStates !== undefined && output . LocationStates !== null ? deserializeAws_json1_1LocationStateList ( output . LocationStates , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateGameServerGroupOutput = ( output , context ) : CreateGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateGameSessionOutput = ( output , context ) : CreateGameSessionOutput => { return { GameSession : output . GameSession !== undefined && output . GameSession !== null ? deserializeAws_json1_1GameSession ( output . GameSession , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateGameSessionQueueOutput = ( output , context ) : CreateGameSessionQueueOutput => { return { GameSessionQueue : output . GameSessionQueue !== undefined && output . GameSessionQueue !== null ? deserializeAws_json1_1GameSessionQueue ( output . GameSessionQueue , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateMatchmakingConfigurationOutput = ( output , context ) : CreateMatchmakingConfigurationOutput => { return { Configuration : output . Configuration !== undefined && output . Configuration !== null ? deserializeAws_json1_1MatchmakingConfiguration ( output . Configuration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateMatchmakingRuleSetOutput = ( output , context ) : CreateMatchmakingRuleSetOutput => { return { RuleSet : output . RuleSet !== undefined && output . RuleSet !== null ? deserializeAws_json1_1MatchmakingRuleSet ( output . RuleSet , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreatePlayerSessionOutput = ( output , context ) : CreatePlayerSessionOutput => { return { PlayerSession : output . PlayerSession !== undefined && output . PlayerSession !== null ? deserializeAws_json1_1PlayerSession ( output . PlayerSession , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreatePlayerSessionsOutput = ( output , context ) : CreatePlayerSessionsOutput => { return { PlayerSessions : output . PlayerSessions !== undefined && output . PlayerSessions !== null ? deserializeAws_json1_1PlayerSessionList ( output . PlayerSessions , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateScriptOutput = ( output , context ) : CreateScriptOutput => { return { Script : output . Script !== undefined && output . Script !== null ? deserializeAws_json1_1Script ( output . Script , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateVpcPeeringAuthorizationOutput = ( output , context ) : CreateVpcPeeringAuthorizationOutput => { return { VpcPeeringAuthorization : output . VpcPeeringAuthorization !== undefined && output . VpcPeeringAuthorization !== null ? deserializeAws_json1_1VpcPeeringAuthorization ( output . VpcPeeringAuthorization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateVpcPeeringConnectionOutput = ( output , context ) : CreateVpcPeeringConnectionOutput => { return { } as any ; } ; const deserializeAws_json1_1DeleteFleetLocationsOutput = ( output , context ) : DeleteFleetLocationsOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , LocationStates : output . LocationStates !== undefined && output . LocationStates !== null ? deserializeAws_json1_1LocationStateList ( output . LocationStates , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeleteGameServerGroupOutput = ( output , context ) : DeleteGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeleteGameSessionQueueOutput = ( output , context ) : DeleteGameSessionQueueOutput => { return { } as any ; } ; const deserializeAws_json1_1DeleteMatchmakingConfigurationOutput = ( output , context ) : DeleteMatchmakingConfigurationOutput => { return { } as any ; } ; const deserializeAws_json1_1DeleteMatchmakingRuleSetOutput = ( output , context ) : DeleteMatchmakingRuleSetOutput => { return { } as any ; } ; const deserializeAws_json1_1DeleteVpcPeeringAuthorizationOutput = ( output , context ) : DeleteVpcPeeringAuthorizationOutput => { return { } as any ; } ; const deserializeAws_json1_1DeleteVpcPeeringConnectionOutput = ( output , context ) : DeleteVpcPeeringConnectionOutput => { return { } as any ; } ; const deserializeAws_json1_1DescribeAliasOutput = ( output , context ) : DescribeAliasOutput => { return { Alias : output . Alias !== undefined && output . Alias !== null ? deserializeAws_json1_1Alias ( output . Alias , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeBuildOutput = ( output , context ) : DescribeBuildOutput => { return { Build : output . Build !== undefined && output . Build !== null ? deserializeAws_json1_1Build ( output . Build , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeEC2InstanceLimitsOutput = ( output , context ) : DescribeEC2InstanceLimitsOutput => { return { EC2InstanceLimits : output . EC2InstanceLimits !== undefined && output . EC2InstanceLimits !== null ? deserializeAws_json1_1EC2InstanceLimitList ( output . EC2InstanceLimits , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeFleetAttributesOutput = ( output , context ) : DescribeFleetAttributesOutput => { return { FleetAttributes : output . FleetAttributes !== undefined && output . FleetAttributes !== null ? deserializeAws_json1_1FleetAttributesList ( output . FleetAttributes , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeFleetCapacityOutput = ( output , context ) : DescribeFleetCapacityOutput => { return { FleetCapacity : output . FleetCapacity !== undefined && output . FleetCapacity !== null ? deserializeAws_json1_1FleetCapacityList ( output . FleetCapacity , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeFleetEventsOutput = ( output , context ) : DescribeFleetEventsOutput => { return { Events : output . Events !== undefined && output . Events !== null ? deserializeAws_json1_1EventList ( output . Events , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeFleetLocationAttributesOutput = ( output , context ) : DescribeFleetLocationAttributesOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , LocationAttributes : output . LocationAttributes !== undefined && output . LocationAttributes !== null ? deserializeAws_json1_1LocationAttributesList ( output . LocationAttributes , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeFleetLocationCapacityOutput = ( output , context ) : DescribeFleetLocationCapacityOutput => { return { FleetCapacity : output . FleetCapacity !== undefined && output . FleetCapacity !== null ? deserializeAws_json1_1FleetCapacity ( output . FleetCapacity , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeFleetLocationUtilizationOutput = ( output , context ) : DescribeFleetLocationUtilizationOutput => { return { FleetUtilization : output . FleetUtilization !== undefined && output . FleetUtilization !== null ? deserializeAws_json1_1FleetUtilization ( output . FleetUtilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeFleetPortSettingsOutput = ( output , context ) : DescribeFleetPortSettingsOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , InboundPermissions : output . InboundPermissions !== undefined && output . InboundPermissions !== null ? deserializeAws_json1_1IpPermissionsList ( output . InboundPermissions , context ) : undefined , Location : __expectString ( output . Location ) , UpdateStatus : __expectString ( output . UpdateStatus ) , } as any ; } ; const deserializeAws_json1_1DescribeFleetUtilizationOutput = ( output , context ) : DescribeFleetUtilizationOutput => { return { FleetUtilization : output . FleetUtilization !== undefined && output . FleetUtilization !== null ? deserializeAws_json1_1FleetUtilizationList ( output . FleetUtilization , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeGameServerGroupOutput = ( output , context ) : DescribeGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeGameServerInstancesOutput = ( output , context ) : DescribeGameServerInstancesOutput => { return { GameServerInstances : output . GameServerInstances !== undefined && output . GameServerInstances !== null ? deserializeAws_json1_1GameServerInstances ( output . GameServerInstances , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeGameServerOutput = ( output , context ) : DescribeGameServerOutput => { return { GameServer : output . GameServer !== undefined && output . GameServer !== null ? deserializeAws_json1_1GameServer ( output . GameServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeGameSessionDetailsOutput = ( output , context ) : DescribeGameSessionDetailsOutput => { return { GameSessionDetails : output . GameSessionDetails !== undefined && output . GameSessionDetails !== null ? deserializeAws_json1_1GameSessionDetailList ( output . GameSessionDetails , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeGameSessionPlacementOutput = ( output , context ) : DescribeGameSessionPlacementOutput => { return { GameSessionPlacement : output . GameSessionPlacement !== undefined && output . GameSessionPlacement !== null ? deserializeAws_json1_1GameSessionPlacement ( output . GameSessionPlacement , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeGameSessionQueuesOutput = ( output , context ) : DescribeGameSessionQueuesOutput => { return { GameSessionQueues : output . GameSessionQueues !== undefined && output . GameSessionQueues !== null ? deserializeAws_json1_1GameSessionQueueList ( output . GameSessionQueues , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeGameSessionsOutput = ( output , context ) : DescribeGameSessionsOutput => { return { GameSessions : output . GameSessions !== undefined && output . GameSessions !== null ? deserializeAws_json1_1GameSessionList ( output . GameSessions , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeInstancesOutput = ( output , context ) : DescribeInstancesOutput => { return { Instances : output . Instances !== undefined && output . Instances !== null ? deserializeAws_json1_1InstanceList ( output . Instances , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeMatchmakingConfigurationsOutput = ( output , context ) : DescribeMatchmakingConfigurationsOutput => { return { Configurations : output . Configurations !== undefined && output . Configurations !== null ? deserializeAws_json1_1MatchmakingConfigurationList ( output . Configurations , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeMatchmakingOutput = ( output , context ) : DescribeMatchmakingOutput => { return { TicketList : output . TicketList !== undefined && output . TicketList !== null ? deserializeAws_json1_1MatchmakingTicketList ( output . TicketList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeMatchmakingRuleSetsOutput = ( output , context ) : DescribeMatchmakingRuleSetsOutput => { return { NextToken : __expectString ( output . NextToken ) , RuleSets : output . RuleSets !== undefined && output . RuleSets !== null ? deserializeAws_json1_1MatchmakingRuleSetList ( output . RuleSets , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribePlayerSessionsOutput = ( output , context ) : DescribePlayerSessionsOutput => { return { NextToken : __expectString ( output . NextToken ) , PlayerSessions : output . PlayerSessions !== undefined && output . PlayerSessions !== null ? deserializeAws_json1_1PlayerSessionList ( output . PlayerSessions , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeRuntimeConfigurationOutput = ( output , context ) : DescribeRuntimeConfigurationOutput => { return { RuntimeConfiguration : output . RuntimeConfiguration !== undefined && output . RuntimeConfiguration !== null ? deserializeAws_json1_1RuntimeConfiguration ( output . RuntimeConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeScalingPoliciesOutput = ( output , context ) : DescribeScalingPoliciesOutput => { return { NextToken : __expectString ( output . NextToken ) , ScalingPolicies : output . ScalingPolicies !== undefined && output . ScalingPolicies !== null ? deserializeAws_json1_1ScalingPolicyList ( output . ScalingPolicies , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeScriptOutput = ( output , context ) : DescribeScriptOutput => { return { Script : output . Script !== undefined && output . Script !== null ? deserializeAws_json1_1Script ( output . Script , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeVpcPeeringAuthorizationsOutput = ( output , context ) : DescribeVpcPeeringAuthorizationsOutput => { return { VpcPeeringAuthorizations : output . VpcPeeringAuthorizations !== undefined && output . VpcPeeringAuthorizations !== null ? deserializeAws_json1_1VpcPeeringAuthorizationList ( output . VpcPeeringAuthorizations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeVpcPeeringConnectionsOutput = ( output , context ) : DescribeVpcPeeringConnectionsOutput => { return { VpcPeeringConnections : output . VpcPeeringConnections !== undefined && output . VpcPeeringConnections !== null ? deserializeAws_json1_1VpcPeeringConnectionList ( output . VpcPeeringConnections , context ) : undefined , } as any ; } ; const deserializeAws_json1_1EC2InstanceCounts = ( output , context ) : EC2InstanceCounts => { return { ACTIVE : __expectInt32 ( output . ACTIVE ) , DESIRED : __expectInt32 ( output . DESIRED ) , IDLE : __expectInt32 ( output . IDLE ) , MAXIMUM : __expectInt32 ( output . MAXIMUM ) , MINIMUM : __expectInt32 ( output . MINIMUM ) , PENDING : __expectInt32 ( output . PENDING ) , TERMINATING : __expectInt32 ( output . TERMINATING ) , } as any ; } ; const deserializeAws_json1_1EC2InstanceLimit = ( output , context ) : EC2InstanceLimit => { return { CurrentInstances : __expectInt32 ( output . CurrentInstances ) , EC2InstanceType : __expectString ( output . EC2InstanceType ) , InstanceLimit : __expectInt32 ( output . InstanceLimit ) , Location : __expectString ( output . Location ) , } as any ; } ; const deserializeAws_json1_1EC2InstanceLimitList = ( output , context ) : EC2InstanceLimit [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EC2InstanceLimit ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Event = ( output , context ) : Event => { return { EventCode : __expectString ( output . EventCode ) , EventId : __expectString ( output . EventId ) , EventTime : output . EventTime !== undefined && output . EventTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . EventTime ) ) ) : undefined , Message : __expectString ( output . Message ) , PreSignedLogUrl : __expectString ( output . PreSignedLogUrl ) , ResourceId : __expectString ( output . ResourceId ) , } as any ; } ; const deserializeAws_json1_1EventList = ( output , context ) : Event [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Event ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FilterConfiguration = ( output , context ) : FilterConfiguration => { return { AllowedLocations : output . AllowedLocations !== undefined && output . AllowedLocations !== null ? deserializeAws_json1_1LocationList ( output . AllowedLocations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1FleetActionList = ( output , context ) : ( FleetAction | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1FleetAttributes = ( output , context ) : FleetAttributes => { return { BuildArn : __expectString ( output . BuildArn ) , BuildId : __expectString ( output . BuildId ) , CertificateConfiguration : output . CertificateConfiguration !== undefined && output . CertificateConfiguration !== null ? deserializeAws_json1_1CertificateConfiguration ( output . CertificateConfiguration , context ) : undefined , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , Description : __expectString ( output . Description ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , FleetType : __expectString ( output . FleetType ) , InstanceRoleArn : __expectString ( output . InstanceRoleArn ) , InstanceType : __expectString ( output . InstanceType ) , LogPaths : output . LogPaths !== undefined && output . LogPaths !== null ? deserializeAws_json1_1StringList ( output . LogPaths , context ) : undefined , MetricGroups : output . MetricGroups !== undefined && output . MetricGroups !== null ? deserializeAws_json1_1MetricGroupList ( output . MetricGroups , context ) : undefined , Name : __expectString ( output . Name ) , NewGameSessionProtectionPolicy : __expectString ( output . NewGameSessionProtectionPolicy ) , OperatingSystem : __expectString ( output . OperatingSystem ) , ResourceCreationLimitPolicy : output . ResourceCreationLimitPolicy !== undefined && output . ResourceCreationLimitPolicy !== null ? deserializeAws_json1_1ResourceCreationLimitPolicy ( output . ResourceCreationLimitPolicy , context ) : undefined , ScriptArn : __expectString ( output . ScriptArn ) , ScriptId : __expectString ( output . ScriptId ) , ServerLaunchParameters : __expectString ( output . ServerLaunchParameters ) , ServerLaunchPath : __expectString ( output . ServerLaunchPath ) , Status : __expectString ( output . Status ) , StoppedActions : output . StoppedActions !== undefined && output . StoppedActions !== null ? deserializeAws_json1_1FleetActionList ( output . StoppedActions , context ) : undefined , TerminationTime : output . TerminationTime !== undefined && output . TerminationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . TerminationTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1FleetAttributesList = ( output , context ) : FleetAttributes [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FleetAttributes ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FleetCapacity = ( output , context ) : FleetCapacity => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , InstanceCounts : output . InstanceCounts !== undefined && output . InstanceCounts !== null ? deserializeAws_json1_1EC2InstanceCounts ( output . InstanceCounts , context ) : undefined , InstanceType : __expectString ( output . InstanceType ) , Location : __expectString ( output . Location ) , } as any ; } ; const deserializeAws_json1_1FleetCapacityExceededException = ( output , context ) : FleetCapacityExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1FleetCapacityList = ( output , context ) : FleetCapacity [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FleetCapacity ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FleetIdList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1FleetUtilization = ( output , context ) : FleetUtilization => { return { ActiveGameSessionCount : __expectInt32 ( output . ActiveGameSessionCount ) , ActiveServerProcessCount : __expectInt32 ( output . ActiveServerProcessCount ) , CurrentPlayerSessionCount : __expectInt32 ( output . CurrentPlayerSessionCount ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , Location : __expectString ( output . Location ) , MaximumPlayerSessionCount : __expectInt32 ( output . MaximumPlayerSessionCount ) , } as any ; } ; const deserializeAws_json1_1FleetUtilizationList = ( output , context ) : FleetUtilization [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FleetUtilization ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameProperty = ( output , context ) : GameProperty => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1GamePropertyList = ( output , context ) : GameProperty [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameProperty ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameServer = ( output , context ) : GameServer => { return { ClaimStatus : __expectString ( output . ClaimStatus ) , ConnectionInfo : __expectString ( output . ConnectionInfo ) , GameServerData : __expectString ( output . GameServerData ) , GameServerGroupArn : __expectString ( output . GameServerGroupArn ) , GameServerGroupName : __expectString ( output . GameServerGroupName ) , GameServerId : __expectString ( output . GameServerId ) , InstanceId : __expectString ( output . InstanceId ) , LastClaimTime : output . LastClaimTime !== undefined && output . LastClaimTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastClaimTime ) ) ) : undefined , LastHealthCheckTime : output . LastHealthCheckTime !== undefined && output . LastHealthCheckTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastHealthCheckTime ) ) ) : undefined , RegistrationTime : output . RegistrationTime !== undefined && output . RegistrationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . RegistrationTime ) ) ) : undefined , UtilizationStatus : __expectString ( output . UtilizationStatus ) , } as any ; } ; const deserializeAws_json1_1GameServerGroup = ( output , context ) : GameServerGroup => { return { AutoScalingGroupArn : __expectString ( output . AutoScalingGroupArn ) , BalancingStrategy : __expectString ( output . BalancingStrategy ) , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , GameServerGroupArn : __expectString ( output . GameServerGroupArn ) , GameServerGroupName : __expectString ( output . GameServerGroupName ) , GameServerProtectionPolicy : __expectString ( output . GameServerProtectionPolicy ) , InstanceDefinitions : output . InstanceDefinitions !== undefined && output . InstanceDefinitions !== null ? deserializeAws_json1_1InstanceDefinitions ( output . InstanceDefinitions , context ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , RoleArn : __expectString ( output . RoleArn ) , Status : __expectString ( output . Status ) , StatusReason : __expectString ( output . StatusReason ) , SuspendedActions : output . SuspendedActions !== undefined && output . SuspendedActions !== null ? deserializeAws_json1_1GameServerGroupActions ( output . SuspendedActions , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GameServerGroupActions = ( output , context ) : ( GameServerGroupAction | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1GameServerGroups = ( output , context ) : GameServerGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameServerGroup ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameServerInstance = ( output , context ) : GameServerInstance => { return { GameServerGroupArn : __expectString ( output . GameServerGroupArn ) , GameServerGroupName : __expectString ( output . GameServerGroupName ) , InstanceId : __expectString ( output . InstanceId ) , InstanceStatus : __expectString ( output . InstanceStatus ) , } as any ; } ; const deserializeAws_json1_1GameServerInstances = ( output , context ) : GameServerInstance [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameServerInstance ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameServers = ( output , context ) : GameServer [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameServer ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameSession = ( output , context ) : GameSession => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , CreatorId : __expectString ( output . CreatorId ) , CurrentPlayerSessionCount : __expectInt32 ( output . CurrentPlayerSessionCount ) , DnsName : __expectString ( output . DnsName ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , GameProperties : output . GameProperties !== undefined && output . GameProperties !== null ? deserializeAws_json1_1GamePropertyList ( output . GameProperties , context ) : undefined , GameSessionData : __expectString ( output . GameSessionData ) , GameSessionId : __expectString ( output . GameSessionId ) , IpAddress : __expectString ( output . IpAddress ) , Location : __expectString ( output . Location ) , MatchmakerData : __expectString ( output . MatchmakerData ) , MaximumPlayerSessionCount : __expectInt32 ( output . MaximumPlayerSessionCount ) , Name : __expectString ( output . Name ) , PlayerSessionCreationPolicy : __expectString ( output . PlayerSessionCreationPolicy ) , Port : __expectInt32 ( output . Port ) , Status : __expectString ( output . Status ) , StatusReason : __expectString ( output . StatusReason ) , TerminationTime : output . TerminationTime !== undefined && output . TerminationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . TerminationTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1GameSessionConnectionInfo = ( output , context ) : GameSessionConnectionInfo => { return { DnsName : __expectString ( output . DnsName ) , GameSessionArn : __expectString ( output . GameSessionArn ) , IpAddress : __expectString ( output . IpAddress ) , MatchedPlayerSessions : output . MatchedPlayerSessions !== undefined && output . MatchedPlayerSessions !== null ? deserializeAws_json1_1MatchedPlayerSessionList ( output . MatchedPlayerSessions , context ) : undefined , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_json1_1GameSessionDetail = ( output , context ) : GameSessionDetail => { return { GameSession : output . GameSession !== undefined && output . GameSession !== null ? deserializeAws_json1_1GameSession ( output . GameSession , context ) : undefined , ProtectionPolicy : __expectString ( output . ProtectionPolicy ) , } as any ; } ; const deserializeAws_json1_1GameSessionDetailList = ( output , context ) : GameSessionDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameSessionDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameSessionFullException = ( output , context ) : GameSessionFullException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1GameSessionList = ( output , context ) : GameSession [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameSession ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameSessionPlacement = ( output , context ) : GameSessionPlacement => { return { DnsName : __expectString ( output . DnsName ) , EndTime : output . EndTime !== undefined && output . EndTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . EndTime ) ) ) : undefined , GameProperties : output . GameProperties !== undefined && output . GameProperties !== null ? deserializeAws_json1_1GamePropertyList ( output . GameProperties , context ) : undefined , GameSessionArn : __expectString ( output . GameSessionArn ) , GameSessionData : __expectString ( output . GameSessionData ) , GameSessionId : __expectString ( output . GameSessionId ) , GameSessionName : __expectString ( output . GameSessionName ) , GameSessionQueueName : __expectString ( output . GameSessionQueueName ) , GameSessionRegion : __expectString ( output . GameSessionRegion ) , IpAddress : __expectString ( output . IpAddress ) , MatchmakerData : __expectString ( output . MatchmakerData ) , MaximumPlayerSessionCount : __expectInt32 ( output . MaximumPlayerSessionCount ) , PlacedPlayerSessions : output . PlacedPlayerSessions !== undefined && output . PlacedPlayerSessions !== null ? deserializeAws_json1_1PlacedPlayerSessionList ( output . PlacedPlayerSessions , context ) : undefined , PlacementId : __expectString ( output . PlacementId ) , PlayerLatencies : output . PlayerLatencies !== undefined && output . PlayerLatencies !== null ? deserializeAws_json1_1PlayerLatencyList ( output . PlayerLatencies , context ) : undefined , Port : __expectInt32 ( output . Port ) , StartTime : output . StartTime !== undefined && output . StartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartTime ) ) ) : undefined , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1GameSessionQueue = ( output , context ) : GameSessionQueue => { return { CustomEventData : __expectString ( output . CustomEventData ) , Destinations : output . Destinations !== undefined && output . Destinations !== null ? deserializeAws_json1_1GameSessionQueueDestinationList ( output . Destinations , context ) : undefined , FilterConfiguration : output . FilterConfiguration !== undefined && output . FilterConfiguration !== null ? deserializeAws_json1_1FilterConfiguration ( output . FilterConfiguration , context ) : undefined , GameSessionQueueArn : __expectString ( output . GameSessionQueueArn ) , Name : __expectString ( output . Name ) , NotificationTarget : __expectString ( output . NotificationTarget ) , PlayerLatencyPolicies : output . PlayerLatencyPolicies !== undefined && output . PlayerLatencyPolicies !== null ? deserializeAws_json1_1PlayerLatencyPolicyList ( output . PlayerLatencyPolicies , context ) : undefined , PriorityConfiguration : output . PriorityConfiguration !== undefined && output . PriorityConfiguration !== null ? deserializeAws_json1_1PriorityConfiguration ( output . PriorityConfiguration , context ) : undefined , TimeoutInSeconds : __expectInt32 ( output . TimeoutInSeconds ) , } as any ; } ; const deserializeAws_json1_1GameSessionQueueDestination = ( output , context ) : GameSessionQueueDestination => { return { DestinationArn : __expectString ( output . DestinationArn ) , } as any ; } ; const deserializeAws_json1_1GameSessionQueueDestinationList = ( output , context ) : GameSessionQueueDestination [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameSessionQueueDestination ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GameSessionQueueList = ( output , context ) : GameSessionQueue [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GameSessionQueue ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GetGameSessionLogUrlOutput = ( output , context ) : GetGameSessionLogUrlOutput => { return { PreSignedUrl : __expectString ( output . PreSignedUrl ) , } as any ; } ; const deserializeAws_json1_1GetInstanceAccessOutput = ( output , context ) : GetInstanceAccessOutput => { return { InstanceAccess : output . InstanceAccess !== undefined && output . InstanceAccess !== null ? deserializeAws_json1_1InstanceAccess ( output . InstanceAccess , context ) : undefined , } as any ; } ; const deserializeAws_json1_1IdempotentParameterMismatchException = ( output , context ) : IdempotentParameterMismatchException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1Instance = ( output , context ) : Instance => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , DnsName : __expectString ( output . DnsName ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , InstanceId : __expectString ( output . InstanceId ) , IpAddress : __expectString ( output . IpAddress ) , Location : __expectString ( output . Location ) , OperatingSystem : __expectString ( output . OperatingSystem ) , Status : __expectString ( output . Status ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1InstanceAccess = ( output , context ) : InstanceAccess => { return { Credentials : output . Credentials !== undefined && output . Credentials !== null ? deserializeAws_json1_1InstanceCredentials ( output . Credentials , context ) : undefined , FleetId : __expectString ( output . FleetId ) , InstanceId : __expectString ( output . InstanceId ) , IpAddress : __expectString ( output . IpAddress ) , OperatingSystem : __expectString ( output . OperatingSystem ) , } as any ; } ; const deserializeAws_json1_1InstanceCredentials = ( output , context ) : InstanceCredentials => { return { Secret : __expectString ( output . Secret ) , UserName : __expectString ( output . UserName ) , } as any ; } ; const deserializeAws_json1_1InstanceDefinition = ( output , context ) : InstanceDefinition => { return { InstanceType : __expectString ( output . InstanceType ) , WeightedCapacity : __expectString ( output . WeightedCapacity ) , } as any ; } ; const deserializeAws_json1_1InstanceDefinitions = ( output , context ) : InstanceDefinition [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1InstanceDefinition ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1InstanceList = ( output , context ) : Instance [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Instance ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1InternalServiceException = ( output , context ) : InternalServiceException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1InvalidFleetStatusException = ( output , context ) : InvalidFleetStatusException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1InvalidGameSessionStatusException = ( output , context ) : InvalidGameSessionStatusException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1InvalidRequestException = ( output , context ) : InvalidRequestException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1IpPermission = ( output , context ) : IpPermission => { return { FromPort : __expectInt32 ( output . FromPort ) , IpRange : __expectString ( output . IpRange ) , Protocol : __expectString ( output . Protocol ) , ToPort : __expectInt32 ( output . ToPort ) , } as any ; } ; const deserializeAws_json1_1IpPermissionsList = ( output , context ) : IpPermission [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1IpPermission ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LatencyMap = ( output , context ) : { [ key ] : number ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectInt32 ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1LimitExceededException = ( output , context ) : LimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ListAliasesOutput = ( output , context ) : ListAliasesOutput => { return { Aliases : output . Aliases !== undefined && output . Aliases !== null ? deserializeAws_json1_1AliasList ( output . Aliases , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListBuildsOutput = ( output , context ) : ListBuildsOutput => { return { Builds : output . Builds !== undefined && output . Builds !== null ? deserializeAws_json1_1BuildList ( output . Builds , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListFleetsOutput = ( output , context ) : ListFleetsOutput => { return { FleetIds : output . FleetIds !== undefined && output . FleetIds !== null ? deserializeAws_json1_1FleetIdList ( output . FleetIds , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListGameServerGroupsOutput = ( output , context ) : ListGameServerGroupsOutput => { return { GameServerGroups : output . GameServerGroups !== undefined && output . GameServerGroups !== null ? deserializeAws_json1_1GameServerGroups ( output . GameServerGroups , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListGameServersOutput = ( output , context ) : ListGameServersOutput => { return { GameServers : output . GameServers !== undefined && output . GameServers !== null ? deserializeAws_json1_1GameServers ( output . GameServers , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListScriptsOutput = ( output , context ) : ListScriptsOutput => { return { NextToken : __expectString ( output . NextToken ) , Scripts : output . Scripts !== undefined && output . Scripts !== null ? deserializeAws_json1_1ScriptList ( output . Scripts , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTagsForResourceResponse = ( output , context ) : ListTagsForResourceResponse => { return { Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1LocationAttributes = ( output , context ) : LocationAttributes => { return { LocationState : output . LocationState !== undefined && output . LocationState !== null ? deserializeAws_json1_1LocationState ( output . LocationState , context ) : undefined , StoppedActions : output . StoppedActions !== undefined && output . StoppedActions !== null ? deserializeAws_json1_1FleetActionList ( output . StoppedActions , context ) : undefined , UpdateStatus : __expectString ( output . UpdateStatus ) , } as any ; } ; const deserializeAws_json1_1LocationAttributesList = ( output , context ) : LocationAttributes [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LocationAttributes ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LocationList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1LocationState = ( output , context ) : LocationState => { return { Location : __expectString ( output . Location ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1LocationStateList = ( output , context ) : LocationState [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LocationState ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MatchedPlayerSession = ( output , context ) : MatchedPlayerSession => { return { PlayerId : __expectString ( output . PlayerId ) , PlayerSessionId : __expectString ( output . PlayerSessionId ) , } as any ; } ; const deserializeAws_json1_1MatchedPlayerSessionList = ( output , context ) : MatchedPlayerSession [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MatchedPlayerSession ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MatchmakingConfiguration = ( output , context ) : MatchmakingConfiguration => { return { AcceptanceRequired : __expectBoolean ( output . AcceptanceRequired ) , AcceptanceTimeoutSeconds : __expectInt32 ( output . AcceptanceTimeoutSeconds ) , AdditionalPlayerCount : __expectInt32 ( output . AdditionalPlayerCount ) , BackfillMode : __expectString ( output . BackfillMode ) , ConfigurationArn : __expectString ( output . ConfigurationArn ) , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , CustomEventData : __expectString ( output . CustomEventData ) , Description : __expectString ( output . Description ) , FlexMatchMode : __expectString ( output . FlexMatchMode ) , GameProperties : output . GameProperties !== undefined && output . GameProperties !== null ? deserializeAws_json1_1GamePropertyList ( output . GameProperties , context ) : undefined , GameSessionData : __expectString ( output . GameSessionData ) , GameSessionQueueArns : output . GameSessionQueueArns !== undefined && output . GameSessionQueueArns !== null ? deserializeAws_json1_1QueueArnsList ( output . GameSessionQueueArns , context ) : undefined , Name : __expectString ( output . Name ) , NotificationTarget : __expectString ( output . NotificationTarget ) , RequestTimeoutSeconds : __expectInt32 ( output . RequestTimeoutSeconds ) , RuleSetArn : __expectString ( output . RuleSetArn ) , RuleSetName : __expectString ( output . RuleSetName ) , } as any ; } ; const deserializeAws_json1_1MatchmakingConfigurationList = ( output , context ) : MatchmakingConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MatchmakingConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MatchmakingRuleSet = ( output , context ) : MatchmakingRuleSet => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , RuleSetArn : __expectString ( output . RuleSetArn ) , RuleSetBody : __expectString ( output . RuleSetBody ) , RuleSetName : __expectString ( output . RuleSetName ) , } as any ; } ; const deserializeAws_json1_1MatchmakingRuleSetList = ( output , context ) : MatchmakingRuleSet [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MatchmakingRuleSet ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MatchmakingTicket = ( output , context ) : MatchmakingTicket => { return { ConfigurationArn : __expectString ( output . ConfigurationArn ) , ConfigurationName : __expectString ( output . ConfigurationName ) , EndTime : output . EndTime !== undefined && output . EndTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . EndTime ) ) ) : undefined , EstimatedWaitTime : __expectInt32 ( output . EstimatedWaitTime ) , GameSessionConnectionInfo : output . GameSessionConnectionInfo !== undefined && output . GameSessionConnectionInfo !== null ? deserializeAws_json1_1GameSessionConnectionInfo ( output . GameSessionConnectionInfo , context ) : undefined , Players : output . Players !== undefined && output . Players !== null ? deserializeAws_json1_1PlayerList ( output . Players , context ) : undefined , StartTime : output . StartTime !== undefined && output . StartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartTime ) ) ) : undefined , Status : __expectString ( output . Status ) , StatusMessage : __expectString ( output . StatusMessage ) , StatusReason : __expectString ( output . StatusReason ) , TicketId : __expectString ( output . TicketId ) , } as any ; } ; const deserializeAws_json1_1MatchmakingTicketList = ( output , context ) : MatchmakingTicket [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MatchmakingTicket ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MetricGroupList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1NotFoundException = ( output , context ) : NotFoundException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1OutOfCapacityException = ( output , context ) : OutOfCapacityException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1PlacedPlayerSession = ( output , context ) : PlacedPlayerSession => { return { PlayerId : __expectString ( output . PlayerId ) , PlayerSessionId : __expectString ( output . PlayerSessionId ) , } as any ; } ; const deserializeAws_json1_1PlacedPlayerSessionList = ( output , context ) : PlacedPlayerSession [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PlacedPlayerSession ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Player = ( output , context ) : Player => { return { LatencyInMs : output . LatencyInMs !== undefined && output . LatencyInMs !== null ? deserializeAws_json1_1LatencyMap ( output . LatencyInMs , context ) : undefined , PlayerAttributes : output . PlayerAttributes !== undefined && output . PlayerAttributes !== null ? deserializeAws_json1_1PlayerAttributeMap ( output . PlayerAttributes , context ) : undefined , PlayerId : __expectString ( output . PlayerId ) , Team : __expectString ( output . Team ) , } as any ; } ; const deserializeAws_json1_1PlayerAttributeMap = ( output , context ) : { [ key ] : AttributeValue ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_1AttributeValue ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_1PlayerLatency = ( output , context ) : PlayerLatency => { return { LatencyInMilliseconds : __limitedParseFloat32 ( output . LatencyInMilliseconds ) , PlayerId : __expectString ( output . PlayerId ) , RegionIdentifier : __expectString ( output . RegionIdentifier ) , } as any ; } ; const deserializeAws_json1_1PlayerLatencyList = ( output , context ) : PlayerLatency [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PlayerLatency ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PlayerLatencyPolicy = ( output , context ) : PlayerLatencyPolicy => { return { MaximumIndividualPlayerLatencyMilliseconds : __expectInt32 ( output . MaximumIndividualPlayerLatencyMilliseconds ) , PolicyDurationSeconds : __expectInt32 ( output . PolicyDurationSeconds ) , } as any ; } ; const deserializeAws_json1_1PlayerLatencyPolicyList = ( output , context ) : PlayerLatencyPolicy [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PlayerLatencyPolicy ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PlayerList = ( output , context ) : Player [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Player ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PlayerSession = ( output , context ) : PlayerSession => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , DnsName : __expectString ( output . DnsName ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , GameSessionId : __expectString ( output . GameSessionId ) , IpAddress : __expectString ( output . IpAddress ) , PlayerData : __expectString ( output . PlayerData ) , PlayerId : __expectString ( output . PlayerId ) , PlayerSessionId : __expectString ( output . PlayerSessionId ) , Port : __expectInt32 ( output . Port ) , Status : __expectString ( output . Status ) , TerminationTime : output . TerminationTime !== undefined && output . TerminationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . TerminationTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1PlayerSessionList = ( output , context ) : PlayerSession [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PlayerSession ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PriorityConfiguration = ( output , context ) : PriorityConfiguration => { return { LocationOrder : output . LocationOrder !== undefined && output . LocationOrder !== null ? deserializeAws_json1_1LocationList ( output . LocationOrder , context ) : undefined , PriorityOrder : output . PriorityOrder !== undefined && output . PriorityOrder !== null ? deserializeAws_json1_1PriorityTypeList ( output . PriorityOrder , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PriorityTypeList = ( output , context ) : ( PriorityType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1PutScalingPolicyOutput = ( output , context ) : PutScalingPolicyOutput => { return { Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_1QueueArnsList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1RegisterGameServerOutput = ( output , context ) : RegisterGameServerOutput => { return { GameServer : output . GameServer !== undefined && output . GameServer !== null ? deserializeAws_json1_1GameServer ( output . GameServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1RequestUploadCredentialsOutput = ( output , context ) : RequestUploadCredentialsOutput => { return { StorageLocation : output . StorageLocation !== undefined && output . StorageLocation !== null ? deserializeAws_json1_1S3Location ( output . StorageLocation , context ) : undefined , UploadCredentials : output . UploadCredentials !== undefined && output . UploadCredentials !== null ? deserializeAws_json1_1AwsCredentials ( output . UploadCredentials , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResolveAliasOutput = ( output , context ) : ResolveAliasOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , } as any ; } ; const deserializeAws_json1_1ResourceCreationLimitPolicy = ( output , context ) : ResourceCreationLimitPolicy => { return { NewGameSessionsPerCreator : __expectInt32 ( output . NewGameSessionsPerCreator ) , PolicyPeriodInMinutes : __expectInt32 ( output . PolicyPeriodInMinutes ) , } as any ; } ; const deserializeAws_json1_1ResumeGameServerGroupOutput = ( output , context ) : ResumeGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1RoutingStrategy = ( output , context ) : RoutingStrategy => { return { FleetId : __expectString ( output . FleetId ) , Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1RuntimeConfiguration = ( output , context ) : RuntimeConfiguration => { return { GameSessionActivationTimeoutSeconds : __expectInt32 ( output . GameSessionActivationTimeoutSeconds ) , MaxConcurrentGameSessionActivations : __expectInt32 ( output . MaxConcurrentGameSessionActivations ) , ServerProcesses : output . ServerProcesses !== undefined && output . ServerProcesses !== null ? deserializeAws_json1_1ServerProcessList ( output . ServerProcesses , context ) : undefined , } as any ; } ; const deserializeAws_json1_1S3Location = ( output , context ) : S3Location => { return { Bucket : __expectString ( output . Bucket ) , Key : __expectString ( output . Key ) , ObjectVersion : __expectString ( output . ObjectVersion ) , RoleArn : __expectString ( output . RoleArn ) , } as any ; } ; const deserializeAws_json1_1ScalingPolicy = ( output , context ) : ScalingPolicy => { return { ComparisonOperator : __expectString ( output . ComparisonOperator ) , EvaluationPeriods : __expectInt32 ( output . EvaluationPeriods ) , FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , Location : __expectString ( output . Location ) , MetricName : __expectString ( output . MetricName ) , Name : __expectString ( output . Name ) , PolicyType : __expectString ( output . PolicyType ) , ScalingAdjustment : __expectInt32 ( output . ScalingAdjustment ) , ScalingAdjustmentType : __expectString ( output . ScalingAdjustmentType ) , Status : __expectString ( output . Status ) , TargetConfiguration : output . TargetConfiguration !== undefined && output . TargetConfiguration !== null ? deserializeAws_json1_1TargetConfiguration ( output . TargetConfiguration , context ) : undefined , Threshold : __limitedParseDouble ( output . Threshold ) , UpdateStatus : __expectString ( output . UpdateStatus ) , } as any ; } ; const deserializeAws_json1_1ScalingPolicyList = ( output , context ) : ScalingPolicy [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ScalingPolicy ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Script = ( output , context ) : Script => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , Name : __expectString ( output . Name ) , ScriptArn : __expectString ( output . ScriptArn ) , ScriptId : __expectString ( output . ScriptId ) , SizeOnDisk : __expectLong ( output . SizeOnDisk ) , StorageLocation : output . StorageLocation !== undefined && output . StorageLocation !== null ? deserializeAws_json1_1S3Location ( output . StorageLocation , context ) : undefined , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1ScriptList = ( output , context ) : Script [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Script ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SearchGameSessionsOutput = ( output , context ) : SearchGameSessionsOutput => { return { GameSessions : output . GameSessions !== undefined && output . GameSessions !== null ? deserializeAws_json1_1GameSessionList ( output . GameSessions , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ServerProcess = ( output , context ) : ServerProcess => { return { ConcurrentExecutions : __expectInt32 ( output . ConcurrentExecutions ) , LaunchPath : __expectString ( output . LaunchPath ) , Parameters : __expectString ( output . Parameters ) , } as any ; } ; const deserializeAws_json1_1ServerProcessList = ( output , context ) : ServerProcess [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ServerProcess ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1StartFleetActionsOutput = ( output , context ) : StartFleetActionsOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , } as any ; } ; const deserializeAws_json1_1StartGameSessionPlacementOutput = ( output , context ) : StartGameSessionPlacementOutput => { return { GameSessionPlacement : output . GameSessionPlacement !== undefined && output . GameSessionPlacement !== null ? deserializeAws_json1_1GameSessionPlacement ( output . GameSessionPlacement , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StartMatchBackfillOutput = ( output , context ) : StartMatchBackfillOutput => { return { MatchmakingTicket : output . MatchmakingTicket !== undefined && output . MatchmakingTicket !== null ? deserializeAws_json1_1MatchmakingTicket ( output . MatchmakingTicket , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StartMatchmakingOutput = ( output , context ) : StartMatchmakingOutput => { return { MatchmakingTicket : output . MatchmakingTicket !== undefined && output . MatchmakingTicket !== null ? deserializeAws_json1_1MatchmakingTicket ( output . MatchmakingTicket , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StopFleetActionsOutput = ( output , context ) : StopFleetActionsOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , } as any ; } ; const deserializeAws_json1_1StopGameSessionPlacementOutput = ( output , context ) : StopGameSessionPlacementOutput => { return { GameSessionPlacement : output . GameSessionPlacement !== undefined && output . GameSessionPlacement !== null ? deserializeAws_json1_1GameSessionPlacement ( output . GameSessionPlacement , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StopMatchmakingOutput = ( output , context ) : StopMatchmakingOutput => { return { } as any ; } ; const deserializeAws_json1_1StringDoubleMap = ( output , context ) : { [ key ] : number ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __limitedParseDouble ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1StringList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1SuspendGameServerGroupOutput = ( output , context ) : SuspendGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1TaggingFailedException = ( output , context ) : TaggingFailedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TagResourceResponse = ( output , context ) : TagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1TargetConfiguration = ( output , context ) : TargetConfiguration => { return { TargetValue : __limitedParseDouble ( output . TargetValue ) , } as any ; } ; const deserializeAws_json1_1TerminalRoutingStrategyException = ( output , context ) : TerminalRoutingStrategyException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UnauthorizedException = ( output , context ) : UnauthorizedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedRegionException = ( output , context ) : UnsupportedRegionException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateAliasOutput = ( output , context ) : UpdateAliasOutput => { return { Alias : output . Alias !== undefined && output . Alias !== null ? deserializeAws_json1_1Alias ( output . Alias , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateBuildOutput = ( output , context ) : UpdateBuildOutput => { return { Build : output . Build !== undefined && output . Build !== null ? deserializeAws_json1_1Build ( output . Build , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateFleetAttributesOutput = ( output , context ) : UpdateFleetAttributesOutput => { return { FleetId : __expectString ( output . FleetId ) , } as any ; } ; const deserializeAws_json1_1UpdateFleetCapacityOutput = ( output , context ) : UpdateFleetCapacityOutput => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , Location : __expectString ( output . Location ) , } as any ; } ; const deserializeAws_json1_1UpdateFleetPortSettingsOutput = ( output , context ) : UpdateFleetPortSettingsOutput => { return { FleetId : __expectString ( output . FleetId ) , } as any ; } ; const deserializeAws_json1_1UpdateGameServerGroupOutput = ( output , context ) : UpdateGameServerGroupOutput => { return { GameServerGroup : output . GameServerGroup !== undefined && output . GameServerGroup !== null ? deserializeAws_json1_1GameServerGroup ( output . GameServerGroup , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateGameServerOutput = ( output , context ) : UpdateGameServerOutput => { return { GameServer : output . GameServer !== undefined && output . GameServer !== null ? deserializeAws_json1_1GameServer ( output . GameServer , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateGameSessionOutput = ( output , context ) : UpdateGameSessionOutput => { return { GameSession : output . GameSession !== undefined && output . GameSession !== null ? deserializeAws_json1_1GameSession ( output . GameSession , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateGameSessionQueueOutput = ( output , context ) : UpdateGameSessionQueueOutput => { return { GameSessionQueue : output . GameSessionQueue !== undefined && output . GameSessionQueue !== null ? deserializeAws_json1_1GameSessionQueue ( output . GameSessionQueue , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateMatchmakingConfigurationOutput = ( output , context ) : UpdateMatchmakingConfigurationOutput => { return { Configuration : output . Configuration !== undefined && output . Configuration !== null ? deserializeAws_json1_1MatchmakingConfiguration ( output . Configuration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateRuntimeConfigurationOutput = ( output , context ) : UpdateRuntimeConfigurationOutput => { return { RuntimeConfiguration : output . RuntimeConfiguration !== undefined && output . RuntimeConfiguration !== null ? deserializeAws_json1_1RuntimeConfiguration ( output . RuntimeConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateScriptOutput = ( output , context ) : UpdateScriptOutput => { return { Script : output . Script !== undefined && output . Script !== null ? deserializeAws_json1_1Script ( output . Script , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ValidateMatchmakingRuleSetOutput = ( output , context ) : ValidateMatchmakingRuleSetOutput => { return { Valid : __expectBoolean ( output . Valid ) , } as any ; } ; const deserializeAws_json1_1VpcPeeringAuthorization = ( output , context ) : VpcPeeringAuthorization => { return { CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , ExpirationTime : output . ExpirationTime !== undefined && output . ExpirationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . ExpirationTime ) ) ) : undefined , GameLiftAwsAccountId : __expectString ( output . GameLiftAwsAccountId ) , PeerVpcAwsAccountId : __expectString ( output . PeerVpcAwsAccountId ) , PeerVpcId : __expectString ( output . PeerVpcId ) , } as any ; } ; const deserializeAws_json1_1VpcPeeringAuthorizationList = ( output , context ) : VpcPeeringAuthorization [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1VpcPeeringAuthorization ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1VpcPeeringConnection = ( output , context ) : VpcPeeringConnection => { return { FleetArn : __expectString ( output . FleetArn ) , FleetId : __expectString ( output . FleetId ) , GameLiftVpcId : __expectString ( output . GameLiftVpcId ) , IpV4CidrBlock : __expectString ( output . IpV4CidrBlock ) , PeerVpcId : __expectString ( output . PeerVpcId ) , Status : output . Status !== undefined && output . Status !== null ? deserializeAws_json1_1VpcPeeringConnectionStatus ( output . Status , context ) : undefined , VpcPeeringConnectionId : __expectString ( output . VpcPeeringConnectionId ) , } as any ; } ; const deserializeAws_json1_1VpcPeeringConnectionList = ( output , context ) : VpcPeeringConnection [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1VpcPeeringConnection ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1VpcPeeringConnectionStatus = ( output , context ) : VpcPeeringConnectionStatus => { return { Code : __expectString ( output . Code ) , Message : __expectString ( output . Message ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;