import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectString as __expectString , limitedParseFloat32 as __limitedParseFloat32 , } 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 { BatchCreateVariableCommandInput , BatchCreateVariableCommandOutput , } from "../commands/BatchCreateVariableCommand" ; import { BatchGetVariableCommandInput , BatchGetVariableCommandOutput } from "../commands/BatchGetVariableCommand" ; import { CancelBatchImportJobCommandInput , CancelBatchImportJobCommandOutput , } from "../commands/CancelBatchImportJobCommand" ; import { CancelBatchPredictionJobCommandInput , CancelBatchPredictionJobCommandOutput , } from "../commands/CancelBatchPredictionJobCommand" ; import { CreateBatchImportJobCommandInput , CreateBatchImportJobCommandOutput , } from "../commands/CreateBatchImportJobCommand" ; import { CreateBatchPredictionJobCommandInput , CreateBatchPredictionJobCommandOutput , } from "../commands/CreateBatchPredictionJobCommand" ; import { CreateDetectorVersionCommandInput , CreateDetectorVersionCommandOutput , } from "../commands/CreateDetectorVersionCommand" ; import { CreateModelCommandInput , CreateModelCommandOutput } from "../commands/CreateModelCommand" ; import { CreateModelVersionCommandInput , CreateModelVersionCommandOutput } from "../commands/CreateModelVersionCommand" ; import { CreateRuleCommandInput , CreateRuleCommandOutput } from "../commands/CreateRuleCommand" ; import { CreateVariableCommandInput , CreateVariableCommandOutput } from "../commands/CreateVariableCommand" ; import { DeleteBatchImportJobCommandInput , DeleteBatchImportJobCommandOutput , } from "../commands/DeleteBatchImportJobCommand" ; import { DeleteBatchPredictionJobCommandInput , DeleteBatchPredictionJobCommandOutput , } from "../commands/DeleteBatchPredictionJobCommand" ; import { DeleteDetectorCommandInput , DeleteDetectorCommandOutput } from "../commands/DeleteDetectorCommand" ; import { DeleteDetectorVersionCommandInput , DeleteDetectorVersionCommandOutput , } from "../commands/DeleteDetectorVersionCommand" ; import { DeleteEntityTypeCommandInput , DeleteEntityTypeCommandOutput } from "../commands/DeleteEntityTypeCommand" ; import { DeleteEventCommandInput , DeleteEventCommandOutput } from "../commands/DeleteEventCommand" ; import { DeleteEventsByEventTypeCommandInput , DeleteEventsByEventTypeCommandOutput , } from "../commands/DeleteEventsByEventTypeCommand" ; import { DeleteEventTypeCommandInput , DeleteEventTypeCommandOutput } from "../commands/DeleteEventTypeCommand" ; import { DeleteExternalModelCommandInput , DeleteExternalModelCommandOutput , } from "../commands/DeleteExternalModelCommand" ; import { DeleteLabelCommandInput , DeleteLabelCommandOutput } from "../commands/DeleteLabelCommand" ; import { DeleteModelCommandInput , DeleteModelCommandOutput } from "../commands/DeleteModelCommand" ; import { DeleteModelVersionCommandInput , DeleteModelVersionCommandOutput } from "../commands/DeleteModelVersionCommand" ; import { DeleteOutcomeCommandInput , DeleteOutcomeCommandOutput } from "../commands/DeleteOutcomeCommand" ; import { DeleteRuleCommandInput , DeleteRuleCommandOutput } from "../commands/DeleteRuleCommand" ; import { DeleteVariableCommandInput , DeleteVariableCommandOutput } from "../commands/DeleteVariableCommand" ; import { DescribeDetectorCommandInput , DescribeDetectorCommandOutput } from "../commands/DescribeDetectorCommand" ; import { DescribeModelVersionsCommandInput , DescribeModelVersionsCommandOutput , } from "../commands/DescribeModelVersionsCommand" ; import { GetBatchImportJobsCommandInput , GetBatchImportJobsCommandOutput } from "../commands/GetBatchImportJobsCommand" ; import { GetBatchPredictionJobsCommandInput , GetBatchPredictionJobsCommandOutput , } from "../commands/GetBatchPredictionJobsCommand" ; import { GetDeleteEventsByEventTypeStatusCommandInput , GetDeleteEventsByEventTypeStatusCommandOutput , } from "../commands/GetDeleteEventsByEventTypeStatusCommand" ; import { GetDetectorsCommandInput , GetDetectorsCommandOutput } from "../commands/GetDetectorsCommand" ; import { GetDetectorVersionCommandInput , GetDetectorVersionCommandOutput } from "../commands/GetDetectorVersionCommand" ; import { GetEntityTypesCommandInput , GetEntityTypesCommandOutput } from "../commands/GetEntityTypesCommand" ; import { GetEventCommandInput , GetEventCommandOutput } from "../commands/GetEventCommand" ; import { GetEventPredictionCommandInput , GetEventPredictionCommandOutput } from "../commands/GetEventPredictionCommand" ; import { GetEventTypesCommandInput , GetEventTypesCommandOutput } from "../commands/GetEventTypesCommand" ; import { GetExternalModelsCommandInput , GetExternalModelsCommandOutput } from "../commands/GetExternalModelsCommand" ; import { GetKMSEncryptionKeyCommandInput , GetKMSEncryptionKeyCommandOutput , } from "../commands/GetKMSEncryptionKeyCommand" ; import { GetLabelsCommandInput , GetLabelsCommandOutput } from "../commands/GetLabelsCommand" ; import { GetModelsCommandInput , GetModelsCommandOutput } from "../commands/GetModelsCommand" ; import { GetModelVersionCommandInput , GetModelVersionCommandOutput } from "../commands/GetModelVersionCommand" ; import { GetOutcomesCommandInput , GetOutcomesCommandOutput } from "../commands/GetOutcomesCommand" ; import { GetRulesCommandInput , GetRulesCommandOutput } from "../commands/GetRulesCommand" ; import { GetVariablesCommandInput , GetVariablesCommandOutput } from "../commands/GetVariablesCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { PutDetectorCommandInput , PutDetectorCommandOutput } from "../commands/PutDetectorCommand" ; import { PutEntityTypeCommandInput , PutEntityTypeCommandOutput } from "../commands/PutEntityTypeCommand" ; import { PutEventTypeCommandInput , PutEventTypeCommandOutput } from "../commands/PutEventTypeCommand" ; import { PutExternalModelCommandInput , PutExternalModelCommandOutput } from "../commands/PutExternalModelCommand" ; import { PutKMSEncryptionKeyCommandInput , PutKMSEncryptionKeyCommandOutput , } from "../commands/PutKMSEncryptionKeyCommand" ; import { PutLabelCommandInput , PutLabelCommandOutput } from "../commands/PutLabelCommand" ; import { PutOutcomeCommandInput , PutOutcomeCommandOutput } from "../commands/PutOutcomeCommand" ; import { SendEventCommandInput , SendEventCommandOutput } from "../commands/SendEventCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateDetectorVersionCommandInput , UpdateDetectorVersionCommandOutput , } from "../commands/UpdateDetectorVersionCommand" ; import { UpdateDetectorVersionMetadataCommandInput , UpdateDetectorVersionMetadataCommandOutput , } from "../commands/UpdateDetectorVersionMetadataCommand" ; import { UpdateDetectorVersionStatusCommandInput , UpdateDetectorVersionStatusCommandOutput , } from "../commands/UpdateDetectorVersionStatusCommand" ; import { UpdateEventLabelCommandInput , UpdateEventLabelCommandOutput } from "../commands/UpdateEventLabelCommand" ; import { UpdateModelCommandInput , UpdateModelCommandOutput } from "../commands/UpdateModelCommand" ; import { UpdateModelVersionCommandInput , UpdateModelVersionCommandOutput } from "../commands/UpdateModelVersionCommand" ; import { UpdateModelVersionStatusCommandInput , UpdateModelVersionStatusCommandOutput , } from "../commands/UpdateModelVersionStatusCommand" ; import { UpdateRuleMetadataCommandInput , UpdateRuleMetadataCommandOutput } from "../commands/UpdateRuleMetadataCommand" ; import { UpdateRuleVersionCommandInput , UpdateRuleVersionCommandOutput } from "../commands/UpdateRuleVersionCommand" ; import { UpdateVariableCommandInput , UpdateVariableCommandOutput } from "../commands/UpdateVariableCommand" ; import { AccessDeniedException , BatchCreateVariableError , BatchCreateVariableRequest , BatchCreateVariableResult , BatchGetVariableError , BatchGetVariableRequest , BatchGetVariableResult , BatchImport , BatchPrediction , CancelBatchImportJobRequest , CancelBatchImportJobResult , CancelBatchPredictionJobRequest , CancelBatchPredictionJobResult , ConflictException , CreateBatchImportJobRequest , CreateBatchImportJobResult , CreateBatchPredictionJobRequest , CreateBatchPredictionJobResult , CreateDetectorVersionRequest , CreateDetectorVersionResult , CreateModelRequest , CreateModelResult , CreateModelVersionRequest , CreateModelVersionResult , CreateRuleRequest , CreateRuleResult , CreateVariableRequest , CreateVariableResult , DataValidationMetrics , DeleteBatchImportJobRequest , DeleteBatchImportJobResult , DeleteBatchPredictionJobRequest , DeleteBatchPredictionJobResult , DeleteDetectorRequest , DeleteDetectorResult , DeleteDetectorVersionRequest , DeleteDetectorVersionResult , DeleteEntityTypeRequest , DeleteEntityTypeResult , DeleteEventRequest , DeleteEventResult , DeleteEventsByEventTypeRequest , DeleteEventsByEventTypeResult , DeleteEventTypeRequest , DeleteEventTypeResult , DeleteExternalModelRequest , DeleteExternalModelResult , DeleteLabelRequest , DeleteLabelResult , DeleteModelRequest , DeleteModelResult , DeleteModelVersionRequest , DeleteModelVersionResult , DeleteOutcomeRequest , DeleteOutcomeResult , DeleteRuleRequest , DeleteRuleResult , DeleteVariableRequest , DeleteVariableResult , DescribeDetectorRequest , DescribeDetectorResult , DescribeModelVersionsRequest , DescribeModelVersionsResult , Detector , DetectorVersionSummary , Entity , EntityType , Event , EventType , ExternalEventsDetail , ExternalModel , ExternalModelOutputs , ExternalModelSummary , FieldValidationMessage , FileValidationMessage , GetBatchImportJobsRequest , GetBatchImportJobsResult , GetBatchPredictionJobsRequest , GetBatchPredictionJobsResult , GetDeleteEventsByEventTypeStatusRequest , GetDeleteEventsByEventTypeStatusResult , GetDetectorsRequest , GetDetectorsResult , GetDetectorVersionRequest , GetDetectorVersionResult , GetEntityTypesRequest , GetEntityTypesResult , GetEventPredictionRequest , GetEventPredictionResult , GetEventRequest , GetEventResult , GetEventTypesRequest , GetEventTypesResult , GetExternalModelsRequest , GetExternalModelsResult , GetKMSEncryptionKeyResult , GetLabelsRequest , GetLabelsResult , GetModelsRequest , GetModelsResult , GetModelVersionRequest , GetModelVersionResult , GetOutcomesRequest , GetOutcomesResult , GetRulesRequest , GetRulesResult , GetVariablesRequest , GetVariablesResult , IngestedEventsDetail , IngestedEventStatistics , IngestedEventsTimeWindow , InternalServerException , KMSKey , Label , LabelSchema , ListTagsForResourceRequest , ListTagsForResourceResult , LogOddsMetric , MetricDataPoint , Model , ModelEndpointDataBlob , ModelInputConfiguration , ModelOutputConfiguration , ModelScores , ModelVersion , ModelVersionDetail , Outcome , PutDetectorRequest , PutDetectorResult , PutEntityTypeRequest , PutEntityTypeResult , PutEventTypeRequest , PutEventTypeResult , PutExternalModelRequest , PutExternalModelResult , PutKMSEncryptionKeyRequest , PutKMSEncryptionKeyResult , PutLabelRequest , PutLabelResult , PutOutcomeRequest , PutOutcomeResult , ResourceNotFoundException , ResourceUnavailableException , Rule , RuleDetail , RuleResult , SendEventRequest , SendEventResult , Tag , TagResourceRequest , TagResourceResult , ThrottlingException , TrainingDataSchema , TrainingMetrics , TrainingResult , UntagResourceRequest , UntagResourceResult , UpdateDetectorVersionMetadataRequest , UpdateDetectorVersionMetadataResult , UpdateDetectorVersionRequest , UpdateDetectorVersionResult , UpdateDetectorVersionStatusRequest , UpdateDetectorVersionStatusResult , UpdateEventLabelRequest , UpdateEventLabelResult , UpdateModelRequest , UpdateModelResult , UpdateModelVersionRequest , UpdateModelVersionResult , UpdateModelVersionStatusRequest , UpdateModelVersionStatusResult , UpdateRuleMetadataRequest , UpdateRuleMetadataResult , UpdateRuleVersionRequest , UpdateRuleVersionResult , UpdateVariableRequest , UpdateVariableResult , ValidationException , Variable , VariableEntry , VariableImportanceMetrics , } from "../models/models_0" ; export const serializeAws_json1_1BatchCreateVariableCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.BatchCreateVariable" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchCreateVariableRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1BatchGetVariableCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.BatchGetVariable" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchGetVariableRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CancelBatchImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CancelBatchImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CancelBatchImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CancelBatchPredictionJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CancelBatchPredictionJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CancelBatchPredictionJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateBatchImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateBatchImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateBatchImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateBatchPredictionJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateBatchPredictionJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateBatchPredictionJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateDetectorVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateDetectorVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateDetectorVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateModelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateModel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateModelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateModelVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateModelVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateModelVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateRuleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateRule" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateRuleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateVariableCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.CreateVariable" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateVariableRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteBatchImportJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteBatchImportJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteBatchImportJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteBatchPredictionJobCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteBatchPredictionJob" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteBatchPredictionJobRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteDetectorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteDetector" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteDetectorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteDetectorVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteDetectorVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteDetectorVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteEntityTypeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteEntityType" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteEntityTypeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteEventCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteEvent" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteEventRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteEventsByEventTypeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteEventsByEventType" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteEventsByEventTypeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteEventTypeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteEventType" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteEventTypeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteExternalModelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteExternalModel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteExternalModelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteLabelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteLabel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteLabelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteModelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteModel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteModelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteModelVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteModelVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteModelVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteOutcomeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteOutcome" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteOutcomeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteRuleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteRule" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteRuleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteVariableCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DeleteVariable" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteVariableRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeDetectorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DescribeDetector" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeDetectorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeModelVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.DescribeModelVersions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeModelVersionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetBatchImportJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetBatchImportJobs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetBatchImportJobsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetBatchPredictionJobsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetBatchPredictionJobs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetBatchPredictionJobsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDeleteEventsByEventTypeStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetDeleteEventsByEventTypeStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDeleteEventsByEventTypeStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDetectorsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetDetectors" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDetectorsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDetectorVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetDetectorVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDetectorVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetEntityTypesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetEntityTypes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetEntityTypesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetEventCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetEvent" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetEventRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetEventPredictionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetEventPrediction" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetEventPredictionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetEventTypesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetEventTypes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetEventTypesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetExternalModelsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetExternalModels" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetExternalModelsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetKMSEncryptionKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetKMSEncryptionKey" , } ; const body = "{}" ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLabelsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetLabels" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLabelsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetModelsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetModels" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetModelsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetModelVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetModelVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetModelVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetOutcomesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetOutcomes" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetOutcomesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetRulesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetRules" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetRulesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetVariablesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.GetVariables" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetVariablesRequest ( 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" : "AWSHawksNestServiceFacade.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutDetectorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutDetector" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutDetectorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutEntityTypeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutEntityType" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutEntityTypeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutEventTypeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutEventType" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutEventTypeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutExternalModelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutExternalModel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutExternalModelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutKMSEncryptionKeyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutKMSEncryptionKey" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutKMSEncryptionKeyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutLabelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutLabel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutLabelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutOutcomeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.PutOutcome" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutOutcomeRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SendEventCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.SendEvent" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SendEventRequest ( 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" : "AWSHawksNestServiceFacade.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" : "AWSHawksNestServiceFacade.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDetectorVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateDetectorVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDetectorVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDetectorVersionMetadataCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateDetectorVersionMetadata" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDetectorVersionMetadataRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateDetectorVersionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateDetectorVersionStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateDetectorVersionStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateEventLabelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateEventLabel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateEventLabelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateModelCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateModel" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateModelRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateModelVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateModelVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateModelVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateModelVersionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateModelVersionStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateModelVersionStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateRuleMetadataCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateRuleMetadata" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateRuleMetadataRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateRuleVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateRuleVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateRuleVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateVariableCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSHawksNestServiceFacade.UpdateVariable" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateVariableRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1BatchCreateVariableCommand = async ( output , context ) : Promise < BatchCreateVariableCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchCreateVariableCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchCreateVariableResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchCreateVariableCommandError = async ( output , context ) : Promise < BatchCreateVariableCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1BatchGetVariableCommand = async ( output , context ) : Promise < BatchGetVariableCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchGetVariableCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchGetVariableResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchGetVariableCommandError = async ( output , context ) : Promise < BatchGetVariableCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CancelBatchImportJobCommand = async ( output , context ) : Promise < CancelBatchImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CancelBatchImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CancelBatchImportJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CancelBatchImportJobCommandError = async ( output , context ) : Promise < CancelBatchImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CancelBatchPredictionJobCommand = async ( output , context ) : Promise < CancelBatchPredictionJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CancelBatchPredictionJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CancelBatchPredictionJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CancelBatchPredictionJobCommandError = async ( output , context ) : Promise < CancelBatchPredictionJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateBatchImportJobCommand = async ( output , context ) : Promise < CreateBatchImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateBatchImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateBatchImportJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateBatchImportJobCommandError = async ( output , context ) : Promise < CreateBatchImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateBatchPredictionJobCommand = async ( output , context ) : Promise < CreateBatchPredictionJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateBatchPredictionJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateBatchPredictionJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateBatchPredictionJobCommandError = async ( output , context ) : Promise < CreateBatchPredictionJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateDetectorVersionCommand = async ( output , context ) : Promise < CreateDetectorVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateDetectorVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateDetectorVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateDetectorVersionCommandError = async ( output , context ) : Promise < CreateDetectorVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateModelCommand = async ( output , context ) : Promise < CreateModelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateModelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateModelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateModelCommandError = async ( output , context ) : Promise < CreateModelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateModelVersionCommand = async ( output , context ) : Promise < CreateModelVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateModelVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateModelVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateModelVersionCommandError = async ( output , context ) : Promise < CreateModelVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateRuleCommand = async ( output , context ) : Promise < CreateRuleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateRuleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateRuleResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateRuleCommandError = async ( output , context ) : Promise < CreateRuleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateVariableCommand = async ( output , context ) : Promise < CreateVariableCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateVariableCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateVariableResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateVariableCommandError = async ( output , context ) : Promise < CreateVariableCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteBatchImportJobCommand = async ( output , context ) : Promise < DeleteBatchImportJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteBatchImportJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteBatchImportJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteBatchImportJobCommandError = async ( output , context ) : Promise < DeleteBatchImportJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteBatchPredictionJobCommand = async ( output , context ) : Promise < DeleteBatchPredictionJobCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteBatchPredictionJobCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteBatchPredictionJobResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteBatchPredictionJobCommandError = async ( output , context ) : Promise < DeleteBatchPredictionJobCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteDetectorCommand = async ( output , context ) : Promise < DeleteDetectorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteDetectorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteDetectorResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteDetectorCommandError = async ( output , context ) : Promise < DeleteDetectorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteDetectorVersionCommand = async ( output , context ) : Promise < DeleteDetectorVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteDetectorVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteDetectorVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteDetectorVersionCommandError = async ( output , context ) : Promise < DeleteDetectorVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteEntityTypeCommand = async ( output , context ) : Promise < DeleteEntityTypeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteEntityTypeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteEntityTypeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteEntityTypeCommandError = async ( output , context ) : Promise < DeleteEntityTypeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteEventCommand = async ( output , context ) : Promise < DeleteEventCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteEventCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteEventResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteEventCommandError = async ( output , context ) : Promise < DeleteEventCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteEventsByEventTypeCommand = async ( output , context ) : Promise < DeleteEventsByEventTypeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteEventsByEventTypeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteEventsByEventTypeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteEventsByEventTypeCommandError = async ( output , context ) : Promise < DeleteEventsByEventTypeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteEventTypeCommand = async ( output , context ) : Promise < DeleteEventTypeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteEventTypeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteEventTypeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteEventTypeCommandError = async ( output , context ) : Promise < DeleteEventTypeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteExternalModelCommand = async ( output , context ) : Promise < DeleteExternalModelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteExternalModelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteExternalModelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteExternalModelCommandError = async ( output , context ) : Promise < DeleteExternalModelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteLabelCommand = async ( output , context ) : Promise < DeleteLabelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteLabelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteLabelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteLabelCommandError = async ( output , context ) : Promise < DeleteLabelCommandOutput > => { 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.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteModelCommand = async ( output , context ) : Promise < DeleteModelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteModelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteModelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteModelCommandError = async ( output , context ) : Promise < DeleteModelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteModelVersionCommand = async ( output , context ) : Promise < DeleteModelVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteModelVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteModelVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteModelVersionCommandError = async ( output , context ) : Promise < DeleteModelVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteOutcomeCommand = async ( output , context ) : Promise < DeleteOutcomeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteOutcomeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteOutcomeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteOutcomeCommandError = async ( output , context ) : Promise < DeleteOutcomeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteRuleCommand = async ( output , context ) : Promise < DeleteRuleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteRuleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteRuleResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteRuleCommandError = async ( output , context ) : Promise < DeleteRuleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteVariableCommand = async ( output , context ) : Promise < DeleteVariableCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteVariableCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteVariableResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteVariableCommandError = async ( output , context ) : Promise < DeleteVariableCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeDetectorCommand = async ( output , context ) : Promise < DescribeDetectorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeDetectorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeDetectorResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeDetectorCommandError = async ( output , context ) : Promise < DescribeDetectorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeModelVersionsCommand = async ( output , context ) : Promise < DescribeModelVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeModelVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeModelVersionsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeModelVersionsCommandError = async ( output , context ) : Promise < DescribeModelVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetBatchImportJobsCommand = async ( output , context ) : Promise < GetBatchImportJobsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetBatchImportJobsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetBatchImportJobsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetBatchImportJobsCommandError = async ( output , context ) : Promise < GetBatchImportJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetBatchPredictionJobsCommand = async ( output , context ) : Promise < GetBatchPredictionJobsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetBatchPredictionJobsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetBatchPredictionJobsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetBatchPredictionJobsCommandError = async ( output , context ) : Promise < GetBatchPredictionJobsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommand = async ( output , context ) : Promise < GetDeleteEventsByEventTypeStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDeleteEventsByEventTypeStatusResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDeleteEventsByEventTypeStatusCommandError = async ( output , context ) : Promise < GetDeleteEventsByEventTypeStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetDetectorsCommand = async ( output , context ) : Promise < GetDetectorsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDetectorsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDetectorsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDetectorsCommandError = async ( output , context ) : Promise < GetDetectorsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetDetectorVersionCommand = async ( output , context ) : Promise < GetDetectorVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDetectorVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDetectorVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDetectorVersionCommandError = async ( output , context ) : Promise < GetDetectorVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetEntityTypesCommand = async ( output , context ) : Promise < GetEntityTypesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetEntityTypesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetEntityTypesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetEntityTypesCommandError = async ( output , context ) : Promise < GetEntityTypesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetEventCommand = async ( output , context ) : Promise < GetEventCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetEventCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetEventResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetEventCommandError = async ( output , context ) : Promise < GetEventCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetEventPredictionCommand = async ( output , context ) : Promise < GetEventPredictionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetEventPredictionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetEventPredictionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetEventPredictionCommandError = async ( output , context ) : Promise < GetEventPredictionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.frauddetector#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetEventTypesCommand = async ( output , context ) : Promise < GetEventTypesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetEventTypesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetEventTypesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetEventTypesCommandError = async ( output , context ) : Promise < GetEventTypesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetExternalModelsCommand = async ( output , context ) : Promise < GetExternalModelsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetExternalModelsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetExternalModelsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetExternalModelsCommandError = async ( output , context ) : Promise < GetExternalModelsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetKMSEncryptionKeyCommand = async ( output , context ) : Promise < GetKMSEncryptionKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetKMSEncryptionKeyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetKMSEncryptionKeyResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetKMSEncryptionKeyCommandError = async ( output , context ) : Promise < GetKMSEncryptionKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( 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_1GetLabelsCommand = async ( output , context ) : Promise < GetLabelsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLabelsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLabelsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLabelsCommandError = async ( output , context ) : Promise < GetLabelsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetModelsCommand = async ( output , context ) : Promise < GetModelsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetModelsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetModelsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetModelsCommandError = async ( output , context ) : Promise < GetModelsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetModelVersionCommand = async ( output , context ) : Promise < GetModelVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetModelVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetModelVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetModelVersionCommandError = async ( output , context ) : Promise < GetModelVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetOutcomesCommand = async ( output , context ) : Promise < GetOutcomesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetOutcomesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetOutcomesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetOutcomesCommandError = async ( output , context ) : Promise < GetOutcomesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetRulesCommand = async ( output , context ) : Promise < GetRulesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetRulesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetRulesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetRulesCommandError = async ( output , context ) : Promise < GetRulesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetVariablesCommand = async ( output , context ) : Promise < GetVariablesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetVariablesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetVariablesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetVariablesCommandError = async ( output , context ) : Promise < GetVariablesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForResourceResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutDetectorCommand = async ( output , context ) : Promise < PutDetectorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutDetectorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutDetectorResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutDetectorCommandError = async ( output , context ) : Promise < PutDetectorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutEntityTypeCommand = async ( output , context ) : Promise < PutEntityTypeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutEntityTypeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutEntityTypeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutEntityTypeCommandError = async ( output , context ) : Promise < PutEntityTypeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutEventTypeCommand = async ( output , context ) : Promise < PutEventTypeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutEventTypeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutEventTypeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutEventTypeCommandError = async ( output , context ) : Promise < PutEventTypeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutExternalModelCommand = async ( output , context ) : Promise < PutExternalModelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutExternalModelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutExternalModelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutExternalModelCommandError = async ( output , context ) : Promise < PutExternalModelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutKMSEncryptionKeyCommand = async ( output , context ) : Promise < PutKMSEncryptionKeyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutKMSEncryptionKeyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutKMSEncryptionKeyResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutKMSEncryptionKeyCommandError = async ( output , context ) : Promise < PutKMSEncryptionKeyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutLabelCommand = async ( output , context ) : Promise < PutLabelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutLabelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutLabelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutLabelCommandError = async ( output , context ) : Promise < PutLabelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutOutcomeCommand = async ( output , context ) : Promise < PutOutcomeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutOutcomeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutOutcomeResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutOutcomeCommandError = async ( output , context ) : Promise < PutOutcomeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1SendEventCommand = async ( output , context ) : Promise < SendEventCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SendEventCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SendEventResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SendEventCommandError = async ( output , context ) : Promise < SendEventCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TagResourceResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UntagResourceResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateDetectorVersionCommand = async ( output , context ) : Promise < UpdateDetectorVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDetectorVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDetectorVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDetectorVersionCommandError = async ( output , context ) : Promise < UpdateDetectorVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateDetectorVersionMetadataCommand = async ( output , context ) : Promise < UpdateDetectorVersionMetadataCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDetectorVersionMetadataCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDetectorVersionMetadataResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDetectorVersionMetadataCommandError = async ( output , context ) : Promise < UpdateDetectorVersionMetadataCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateDetectorVersionStatusCommand = async ( output , context ) : Promise < UpdateDetectorVersionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateDetectorVersionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateDetectorVersionStatusResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateDetectorVersionStatusCommandError = async ( output , context ) : Promise < UpdateDetectorVersionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateEventLabelCommand = async ( output , context ) : Promise < UpdateEventLabelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateEventLabelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateEventLabelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateEventLabelCommandError = async ( output , context ) : Promise < UpdateEventLabelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateModelCommand = async ( output , context ) : Promise < UpdateModelCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateModelCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateModelResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateModelCommandError = async ( output , context ) : Promise < UpdateModelCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateModelVersionCommand = async ( output , context ) : Promise < UpdateModelVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateModelVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateModelVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateModelVersionCommandError = async ( output , context ) : Promise < UpdateModelVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateModelVersionStatusCommand = async ( output , context ) : Promise < UpdateModelVersionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateModelVersionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateModelVersionStatusResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateModelVersionStatusCommandError = async ( output , context ) : Promise < UpdateModelVersionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateRuleMetadataCommand = async ( output , context ) : Promise < UpdateRuleMetadataCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateRuleMetadataCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateRuleMetadataResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateRuleMetadataCommandError = async ( output , context ) : Promise < UpdateRuleMetadataCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateRuleVersionCommand = async ( output , context ) : Promise < UpdateRuleVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateRuleVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateRuleVersionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateRuleVersionCommandError = async ( output , context ) : Promise < UpdateRuleVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateVariableCommand = async ( output , context ) : Promise < UpdateVariableCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateVariableCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateVariableResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateVariableCommandError = async ( output , context ) : Promise < UpdateVariableCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.frauddetector#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.frauddetector#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.frauddetector#InternalServerException" : response = { ... ( await deserializeAws_json1_1InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.frauddetector#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.frauddetector#ThrottlingException" : response = { ... ( await deserializeAws_json1_1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.frauddetector#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_1AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AccessDeniedException ( body , context ) ; const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConflictException ( body , context ) ; const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InternalServerExceptionResponse = async ( parsedOutput , context ) : Promise < InternalServerException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InternalServerException ( body , context ) ; const contents = { name : "InternalServerException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceUnavailableExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceUnavailableException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceUnavailableException ( body , context ) ; const contents = { name : "ResourceUnavailableException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ThrottlingException ( body , context ) ; const contents = { name : "ThrottlingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ValidationExceptionResponse = async ( parsedOutput , context ) : Promise < ValidationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ValidationException ( body , context ) ; const contents = { name : "ValidationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1BatchCreateVariableRequest = ( input , context ) : any => { return { ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , ... ( input . variableEntries !== undefined && input . variableEntries !== null && { variableEntries : serializeAws_json1_1VariableEntryList ( input . variableEntries , context ) , } ) , } ; } ; const serializeAws_json1_1BatchGetVariableRequest = ( input , context ) : any => { return { ... ( input . names !== undefined && input . names !== null && { names : serializeAws_json1_1NameList ( input . names , context ) } ) , } ; } ; const serializeAws_json1_1CancelBatchImportJobRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , } ; } ; const serializeAws_json1_1CancelBatchPredictionJobRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , } ; } ; const serializeAws_json1_1CreateBatchImportJobRequest = ( input , context ) : any => { return { ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . iamRoleArn !== undefined && input . iamRoleArn !== null && { iamRoleArn : input . iamRoleArn } ) , ... ( input . inputPath !== undefined && input . inputPath !== null && { inputPath : input . inputPath } ) , ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , ... ( input . outputPath !== undefined && input . outputPath !== null && { outputPath : input . outputPath } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateBatchPredictionJobRequest = ( input , context ) : any => { return { ... ( input . detectorName !== undefined && input . detectorName !== null && { detectorName : input . detectorName } ) , ... ( input . detectorVersion !== undefined && input . detectorVersion !== null && { detectorVersion : input . detectorVersion } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . iamRoleArn !== undefined && input . iamRoleArn !== null && { iamRoleArn : input . iamRoleArn } ) , ... ( input . inputPath !== undefined && input . inputPath !== null && { inputPath : input . inputPath } ) , ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , ... ( input . outputPath !== undefined && input . outputPath !== null && { outputPath : input . outputPath } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateDetectorVersionRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . externalModelEndpoints !== undefined && input . externalModelEndpoints !== null && { externalModelEndpoints : serializeAws_json1_1ListOfStrings ( input . externalModelEndpoints , context ) , } ) , ... ( input . modelVersions !== undefined && input . modelVersions !== null && { modelVersions : serializeAws_json1_1ListOfModelVersions ( input . modelVersions , context ) , } ) , ... ( input . ruleExecutionMode !== undefined && input . ruleExecutionMode !== null && { ruleExecutionMode : input . ruleExecutionMode } ) , ... ( input . rules !== undefined && input . rules !== null && { rules : serializeAws_json1_1RuleList ( input . rules , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateModelRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateModelVersionRequest = ( input , context ) : any => { return { ... ( input . externalEventsDetail !== undefined && input . externalEventsDetail !== null && { externalEventsDetail : serializeAws_json1_1ExternalEventsDetail ( input . externalEventsDetail , context ) , } ) , ... ( input . ingestedEventsDetail !== undefined && input . ingestedEventsDetail !== null && { ingestedEventsDetail : serializeAws_json1_1IngestedEventsDetail ( input . ingestedEventsDetail , context ) , } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , ... ( input . trainingDataSchema !== undefined && input . trainingDataSchema !== null && { trainingDataSchema : serializeAws_json1_1TrainingDataSchema ( input . trainingDataSchema , context ) , } ) , ... ( input . trainingDataSource !== undefined && input . trainingDataSource !== null && { trainingDataSource : input . trainingDataSource } ) , } ; } ; const serializeAws_json1_1CreateRuleRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . expression !== undefined && input . expression !== null && { expression : input . expression } ) , ... ( input . language !== undefined && input . language !== null && { language : input . language } ) , ... ( input . outcomes !== undefined && input . outcomes !== null && { outcomes : serializeAws_json1_1NonEmptyListOfStrings ( input . outcomes , context ) } ) , ... ( input . ruleId !== undefined && input . ruleId !== null && { ruleId : input . ruleId } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateVariableRequest = ( input , context ) : any => { return { ... ( input . dataSource !== undefined && input . dataSource !== null && { dataSource : input . dataSource } ) , ... ( input . dataType !== undefined && input . dataType !== null && { dataType : input . dataType } ) , ... ( input . defaultValue !== undefined && input . defaultValue !== null && { defaultValue : input . defaultValue } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , ... ( input . variableType !== undefined && input . variableType !== null && { variableType : input . variableType } ) , } ; } ; const serializeAws_json1_1CsvIndexToVariableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1DeleteBatchImportJobRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , } ; } ; const serializeAws_json1_1DeleteBatchPredictionJobRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , } ; } ; const serializeAws_json1_1DeleteDetectorRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , } ; } ; const serializeAws_json1_1DeleteDetectorVersionRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , } ; } ; const serializeAws_json1_1DeleteEntityTypeRequest = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1DeleteEventRequest = ( input , context ) : any => { return { ... ( input . deleteAuditHistory !== undefined && input . deleteAuditHistory !== null && { deleteAuditHistory : input . deleteAuditHistory } ) , ... ( input . eventId !== undefined && input . eventId !== null && { eventId : input . eventId } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , } ; } ; const serializeAws_json1_1DeleteEventsByEventTypeRequest = ( input , context ) : any => { return { ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , } ; } ; const serializeAws_json1_1DeleteEventTypeRequest = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1DeleteExternalModelRequest = ( input , context ) : any => { return { ... ( input . modelEndpoint !== undefined && input . modelEndpoint !== null && { modelEndpoint : input . modelEndpoint } ) , } ; } ; const serializeAws_json1_1DeleteLabelRequest = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1DeleteModelRequest = ( input , context ) : any => { return { ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , } ; } ; const serializeAws_json1_1DeleteModelVersionRequest = ( input , context ) : any => { return { ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . modelVersionNumber !== undefined && input . modelVersionNumber !== null && { modelVersionNumber : input . modelVersionNumber } ) , } ; } ; const serializeAws_json1_1DeleteOutcomeRequest = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1DeleteRuleRequest = ( input , context ) : any => { return { ... ( input . rule !== undefined && input . rule !== null && { rule : serializeAws_json1_1Rule ( input . rule , context ) } ) , } ; } ; const serializeAws_json1_1DeleteVariableRequest = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1DescribeDetectorRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeModelVersionsRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . modelVersionNumber !== undefined && input . modelVersionNumber !== null && { modelVersionNumber : input . modelVersionNumber } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1Entity = ( input , context ) : any => { return { ... ( input . entityId !== undefined && input . entityId !== null && { entityId : input . entityId } ) , ... ( input . entityType !== undefined && input . entityType !== null && { entityType : input . entityType } ) , } ; } ; const serializeAws_json1_1EventVariableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1ExternalEventsDetail = ( input , context ) : any => { return { ... ( input . dataAccessRoleArn !== undefined && input . dataAccessRoleArn !== null && { dataAccessRoleArn : input . dataAccessRoleArn } ) , ... ( input . dataLocation !== undefined && input . dataLocation !== null && { dataLocation : input . dataLocation } ) , } ; } ; const serializeAws_json1_1ExternalModelEndpointDataBlobMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_json1_1ModelEndpointDataBlob ( value , context ) , } ; } , { } ) ; } ; const serializeAws_json1_1GetBatchImportJobsRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetBatchPredictionJobsRequest = ( input , context ) : any => { return { ... ( input . jobId !== undefined && input . jobId !== null && { jobId : input . jobId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetDeleteEventsByEventTypeStatusRequest = ( input , context ) : any => { return { ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , } ; } ; const serializeAws_json1_1GetDetectorsRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetDetectorVersionRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , } ; } ; const serializeAws_json1_1GetEntityTypesRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetEventPredictionRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , ... ( input . entities !== undefined && input . entities !== null && { entities : serializeAws_json1_1listOfEntities ( input . entities , context ) } ) , ... ( input . eventId !== undefined && input . eventId !== null && { eventId : input . eventId } ) , ... ( input . eventTimestamp !== undefined && input . eventTimestamp !== null && { eventTimestamp : input . eventTimestamp } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . eventVariables !== undefined && input . eventVariables !== null && { eventVariables : serializeAws_json1_1EventVariableMap ( input . eventVariables , context ) , } ) , ... ( input . externalModelEndpointDataBlobs !== undefined && input . externalModelEndpointDataBlobs !== null && { externalModelEndpointDataBlobs : serializeAws_json1_1ExternalModelEndpointDataBlobMap ( input . externalModelEndpointDataBlobs , context ) , } ) , } ; } ; const serializeAws_json1_1GetEventRequest = ( input , context ) : any => { return { ... ( input . eventId !== undefined && input . eventId !== null && { eventId : input . eventId } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , } ; } ; const serializeAws_json1_1GetEventTypesRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetExternalModelsRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . modelEndpoint !== undefined && input . modelEndpoint !== null && { modelEndpoint : input . modelEndpoint } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetLabelsRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetModelsRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetModelVersionRequest = ( input , context ) : any => { return { ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . modelVersionNumber !== undefined && input . modelVersionNumber !== null && { modelVersionNumber : input . modelVersionNumber } ) , } ; } ; const serializeAws_json1_1GetOutcomesRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1GetRulesRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . ruleId !== undefined && input . ruleId !== null && { ruleId : input . ruleId } ) , ... ( input . ruleVersion !== undefined && input . ruleVersion !== null && { ruleVersion : input . ruleVersion } ) , } ; } ; const serializeAws_json1_1GetVariablesRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1IngestedEventsDetail = ( input , context ) : any => { return { ... ( input . ingestedEventsTimeWindow !== undefined && input . ingestedEventsTimeWindow !== null && { ingestedEventsTimeWindow : serializeAws_json1_1IngestedEventsTimeWindow ( input . ingestedEventsTimeWindow , context ) , } ) , } ; } ; const serializeAws_json1_1IngestedEventsTimeWindow = ( input , context ) : any => { return { ... ( input . endTime !== undefined && input . endTime !== null && { endTime : input . endTime } ) , ... ( input . startTime !== undefined && input . startTime !== null && { startTime : input . startTime } ) , } ; } ; const serializeAws_json1_1JsonKeyToVariableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_json1_1labelMapper = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_json1_1NonEmptyListOfStrings ( value , context ) , } ; } , { } ) ; } ; const serializeAws_json1_1LabelSchema = ( input , context ) : any => { return { ... ( input . labelMapper !== undefined && input . labelMapper !== null && { labelMapper : serializeAws_json1_1labelMapper ( input . labelMapper , context ) } ) , ... ( input . unlabeledEventsTreatment !== undefined && input . unlabeledEventsTreatment !== null && { unlabeledEventsTreatment : input . unlabeledEventsTreatment } ) , } ; } ; const serializeAws_json1_1listOfEntities = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Entity ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ListOfModelVersions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ModelVersion ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ListOfStrings = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . resourceARN !== undefined && input . resourceARN !== null && { resourceARN : input . resourceARN } ) , } ; } ; const serializeAws_json1_1ModelEndpointDataBlob = ( input , context ) : any => { return { ... ( input . byteBuffer !== undefined && input . byteBuffer !== null && { byteBuffer : context . base64Encoder ( input . byteBuffer ) } ) , ... ( input . contentType !== undefined && input . contentType !== null && { contentType : input . contentType } ) , } ; } ; const serializeAws_json1_1ModelInputConfiguration = ( input , context ) : any => { return { ... ( input . csvInputTemplate !== undefined && input . csvInputTemplate !== null && { csvInputTemplate : input . csvInputTemplate } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . format !== undefined && input . format !== null && { format : input . format } ) , ... ( input . jsonInputTemplate !== undefined && input . jsonInputTemplate !== null && { jsonInputTemplate : input . jsonInputTemplate } ) , ... ( input . useEventVariables !== undefined && input . useEventVariables !== null && { useEventVariables : input . useEventVariables } ) , } ; } ; const serializeAws_json1_1ModelOutputConfiguration = ( input , context ) : any => { return { ... ( input . csvIndexToVariableMap !== undefined && input . csvIndexToVariableMap !== null && { csvIndexToVariableMap : serializeAws_json1_1CsvIndexToVariableMap ( input . csvIndexToVariableMap , context ) , } ) , ... ( input . format !== undefined && input . format !== null && { format : input . format } ) , ... ( input . jsonKeyToVariableMap !== undefined && input . jsonKeyToVariableMap !== null && { jsonKeyToVariableMap : serializeAws_json1_1JsonKeyToVariableMap ( input . jsonKeyToVariableMap , context ) , } ) , } ; } ; const serializeAws_json1_1ModelVersion = ( input , context ) : any => { return { ... ( input . arn !== undefined && input . arn !== null && { arn : input . arn } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . modelVersionNumber !== undefined && input . modelVersionNumber !== null && { modelVersionNumber : input . modelVersionNumber } ) , } ; } ; const serializeAws_json1_1NameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1NonEmptyListOfStrings = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PutDetectorRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1PutEntityTypeRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1PutEventTypeRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . entityTypes !== undefined && input . entityTypes !== null && { entityTypes : serializeAws_json1_1NonEmptyListOfStrings ( input . entityTypes , context ) , } ) , ... ( input . eventIngestion !== undefined && input . eventIngestion !== null && { eventIngestion : input . eventIngestion } ) , ... ( input . eventVariables !== undefined && input . eventVariables !== null && { eventVariables : serializeAws_json1_1NonEmptyListOfStrings ( input . eventVariables , context ) , } ) , ... ( input . labels !== undefined && input . labels !== null && { labels : serializeAws_json1_1ListOfStrings ( input . labels , context ) } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1PutExternalModelRequest = ( input , context ) : any => { return { ... ( input . inputConfiguration !== undefined && input . inputConfiguration !== null && { inputConfiguration : serializeAws_json1_1ModelInputConfiguration ( input . inputConfiguration , context ) , } ) , ... ( input . invokeModelEndpointRoleArn !== undefined && input . invokeModelEndpointRoleArn !== null && { invokeModelEndpointRoleArn : input . invokeModelEndpointRoleArn } ) , ... ( input . modelEndpoint !== undefined && input . modelEndpoint !== null && { modelEndpoint : input . modelEndpoint } ) , ... ( input . modelEndpointStatus !== undefined && input . modelEndpointStatus !== null && { modelEndpointStatus : input . modelEndpointStatus } ) , ... ( input . modelSource !== undefined && input . modelSource !== null && { modelSource : input . modelSource } ) , ... ( input . outputConfiguration !== undefined && input . outputConfiguration !== null && { outputConfiguration : serializeAws_json1_1ModelOutputConfiguration ( input . outputConfiguration , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1PutKMSEncryptionKeyRequest = ( input , context ) : any => { return { ... ( input . kmsEncryptionKeyArn !== undefined && input . kmsEncryptionKeyArn !== null && { kmsEncryptionKeyArn : input . kmsEncryptionKeyArn } ) , } ; } ; const serializeAws_json1_1PutLabelRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1PutOutcomeRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1Rule = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . ruleId !== undefined && input . ruleId !== null && { ruleId : input . ruleId } ) , ... ( input . ruleVersion !== undefined && input . ruleVersion !== null && { ruleVersion : input . ruleVersion } ) , } ; } ; const serializeAws_json1_1RuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Rule ( entry , context ) ; } ) ; } ; const serializeAws_json1_1SendEventRequest = ( input , context ) : any => { return { ... ( input . assignedLabel !== undefined && input . assignedLabel !== null && { assignedLabel : input . assignedLabel } ) , ... ( input . entities !== undefined && input . entities !== null && { entities : serializeAws_json1_1listOfEntities ( input . entities , context ) } ) , ... ( input . eventId !== undefined && input . eventId !== null && { eventId : input . eventId } ) , ... ( input . eventTimestamp !== undefined && input . eventTimestamp !== null && { eventTimestamp : input . eventTimestamp } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . eventVariables !== undefined && input . eventVariables !== null && { eventVariables : serializeAws_json1_1EventVariableMap ( input . eventVariables , context ) , } ) , ... ( input . labelTimestamp !== undefined && input . labelTimestamp !== null && { labelTimestamp : input . labelTimestamp } ) , } ; } ; 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_1TrainingDataSchema = ( input , context ) : any => { return { ... ( input . labelSchema !== undefined && input . labelSchema !== null && { labelSchema : serializeAws_json1_1LabelSchema ( input . labelSchema , context ) } ) , ... ( input . modelVariables !== undefined && input . modelVariables !== null && { modelVariables : serializeAws_json1_1ListOfStrings ( input . modelVariables , context ) , } ) , } ; } ; 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_1UpdateDetectorVersionMetadataRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , } ; } ; const serializeAws_json1_1UpdateDetectorVersionRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , ... ( input . externalModelEndpoints !== undefined && input . externalModelEndpoints !== null && { externalModelEndpoints : serializeAws_json1_1ListOfStrings ( input . externalModelEndpoints , context ) , } ) , ... ( input . modelVersions !== undefined && input . modelVersions !== null && { modelVersions : serializeAws_json1_1ListOfModelVersions ( input . modelVersions , context ) , } ) , ... ( input . ruleExecutionMode !== undefined && input . ruleExecutionMode !== null && { ruleExecutionMode : input . ruleExecutionMode } ) , ... ( input . rules !== undefined && input . rules !== null && { rules : serializeAws_json1_1RuleList ( input . rules , context ) } ) , } ; } ; const serializeAws_json1_1UpdateDetectorVersionStatusRequest = ( input , context ) : any => { return { ... ( input . detectorId !== undefined && input . detectorId !== null && { detectorId : input . detectorId } ) , ... ( input . detectorVersionId !== undefined && input . detectorVersionId !== null && { detectorVersionId : input . detectorVersionId } ) , ... ( input . status !== undefined && input . status !== null && { status : input . status } ) , } ; } ; const serializeAws_json1_1UpdateEventLabelRequest = ( input , context ) : any => { return { ... ( input . assignedLabel !== undefined && input . assignedLabel !== null && { assignedLabel : input . assignedLabel } ) , ... ( input . eventId !== undefined && input . eventId !== null && { eventId : input . eventId } ) , ... ( input . eventTypeName !== undefined && input . eventTypeName !== null && { eventTypeName : input . eventTypeName } ) , ... ( input . labelTimestamp !== undefined && input . labelTimestamp !== null && { labelTimestamp : input . labelTimestamp } ) , } ; } ; const serializeAws_json1_1UpdateModelRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , } ; } ; const serializeAws_json1_1UpdateModelVersionRequest = ( input , context ) : any => { return { ... ( input . externalEventsDetail !== undefined && input . externalEventsDetail !== null && { externalEventsDetail : serializeAws_json1_1ExternalEventsDetail ( input . externalEventsDetail , context ) , } ) , ... ( input . ingestedEventsDetail !== undefined && input . ingestedEventsDetail !== null && { ingestedEventsDetail : serializeAws_json1_1IngestedEventsDetail ( input . ingestedEventsDetail , context ) , } ) , ... ( input . majorVersionNumber !== undefined && input . majorVersionNumber !== null && { majorVersionNumber : input . majorVersionNumber } ) , ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1UpdateModelVersionStatusRequest = ( input , context ) : any => { return { ... ( input . modelId !== undefined && input . modelId !== null && { modelId : input . modelId } ) , ... ( input . modelType !== undefined && input . modelType !== null && { modelType : input . modelType } ) , ... ( input . modelVersionNumber !== undefined && input . modelVersionNumber !== null && { modelVersionNumber : input . modelVersionNumber } ) , ... ( input . status !== undefined && input . status !== null && { status : input . status } ) , } ; } ; const serializeAws_json1_1UpdateRuleMetadataRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . rule !== undefined && input . rule !== null && { rule : serializeAws_json1_1Rule ( input . rule , context ) } ) , } ; } ; const serializeAws_json1_1UpdateRuleVersionRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . expression !== undefined && input . expression !== null && { expression : input . expression } ) , ... ( input . language !== undefined && input . language !== null && { language : input . language } ) , ... ( input . outcomes !== undefined && input . outcomes !== null && { outcomes : serializeAws_json1_1NonEmptyListOfStrings ( input . outcomes , context ) } ) , ... ( input . rule !== undefined && input . rule !== null && { rule : serializeAws_json1_1Rule ( input . rule , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1tagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1UpdateVariableRequest = ( input , context ) : any => { return { ... ( input . defaultValue !== undefined && input . defaultValue !== null && { defaultValue : input . defaultValue } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . variableType !== undefined && input . variableType !== null && { variableType : input . variableType } ) , } ; } ; const serializeAws_json1_1VariableEntry = ( input , context ) : any => { return { ... ( input . dataSource !== undefined && input . dataSource !== null && { dataSource : input . dataSource } ) , ... ( input . dataType !== undefined && input . dataType !== null && { dataType : input . dataType } ) , ... ( input . defaultValue !== undefined && input . defaultValue !== null && { defaultValue : input . defaultValue } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . variableType !== undefined && input . variableType !== null && { variableType : input . variableType } ) , } ; } ; const serializeAws_json1_1VariableEntryList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1VariableEntry ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AccessDeniedException = ( output , context ) : AccessDeniedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1BatchCreateVariableError = ( output , context ) : BatchCreateVariableError => { return { code : __expectInt32 ( output . code ) , message : __expectString ( output . message ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1BatchCreateVariableErrorList = ( output , context ) : BatchCreateVariableError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BatchCreateVariableError ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1BatchCreateVariableResult = ( output , context ) : BatchCreateVariableResult => { return { errors : output . errors !== undefined && output . errors !== null ? deserializeAws_json1_1BatchCreateVariableErrorList ( output . errors , context ) : undefined , } as any ; } ; const deserializeAws_json1_1BatchGetVariableError = ( output , context ) : BatchGetVariableError => { return { code : __expectInt32 ( output . code ) , message : __expectString ( output . message ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1BatchGetVariableErrorList = ( output , context ) : BatchGetVariableError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BatchGetVariableError ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1BatchGetVariableResult = ( output , context ) : BatchGetVariableResult => { return { errors : output . errors !== undefined && output . errors !== null ? deserializeAws_json1_1BatchGetVariableErrorList ( output . errors , context ) : undefined , variables : output . variables !== undefined && output . variables !== null ? deserializeAws_json1_1VariableList ( output . variables , context ) : undefined , } as any ; } ; const deserializeAws_json1_1BatchImport = ( output , context ) : BatchImport => { return { arn : __expectString ( output . arn ) , completionTime : __expectString ( output . completionTime ) , eventTypeName : __expectString ( output . eventTypeName ) , failedRecordsCount : __expectInt32 ( output . failedRecordsCount ) , failureReason : __expectString ( output . failureReason ) , iamRoleArn : __expectString ( output . iamRoleArn ) , inputPath : __expectString ( output . inputPath ) , jobId : __expectString ( output . jobId ) , outputPath : __expectString ( output . outputPath ) , processedRecordsCount : __expectInt32 ( output . processedRecordsCount ) , startTime : __expectString ( output . startTime ) , status : __expectString ( output . status ) , totalRecordsCount : __expectInt32 ( output . totalRecordsCount ) , } as any ; } ; const deserializeAws_json1_1BatchImportList = ( output , context ) : BatchImport [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BatchImport ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1BatchPrediction = ( output , context ) : BatchPrediction => { return { arn : __expectString ( output . arn ) , completionTime : __expectString ( output . completionTime ) , detectorName : __expectString ( output . detectorName ) , detectorVersion : __expectString ( output . detectorVersion ) , eventTypeName : __expectString ( output . eventTypeName ) , failureReason : __expectString ( output . failureReason ) , iamRoleArn : __expectString ( output . iamRoleArn ) , inputPath : __expectString ( output . inputPath ) , jobId : __expectString ( output . jobId ) , lastHeartbeatTime : __expectString ( output . lastHeartbeatTime ) , outputPath : __expectString ( output . outputPath ) , processedRecordsCount : __expectInt32 ( output . processedRecordsCount ) , startTime : __expectString ( output . startTime ) , status : __expectString ( output . status ) , totalRecordsCount : __expectInt32 ( output . totalRecordsCount ) , } as any ; } ; const deserializeAws_json1_1BatchPredictionList = ( output , context ) : BatchPrediction [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BatchPrediction ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CancelBatchImportJobResult = ( output , context ) : CancelBatchImportJobResult => { return { } as any ; } ; const deserializeAws_json1_1CancelBatchPredictionJobResult = ( output , context ) : CancelBatchPredictionJobResult => { return { } as any ; } ; const deserializeAws_json1_1ConflictException = ( output , context ) : ConflictException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1CreateBatchImportJobResult = ( output , context ) : CreateBatchImportJobResult => { return { } as any ; } ; const deserializeAws_json1_1CreateBatchPredictionJobResult = ( output , context ) : CreateBatchPredictionJobResult => { return { } as any ; } ; const deserializeAws_json1_1CreateDetectorVersionResult = ( output , context ) : CreateDetectorVersionResult => { return { detectorId : __expectString ( output . detectorId ) , detectorVersionId : __expectString ( output . detectorVersionId ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1CreateModelResult = ( output , context ) : CreateModelResult => { return { } as any ; } ; const deserializeAws_json1_1CreateModelVersionResult = ( output , context ) : CreateModelVersionResult => { return { modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , modelVersionNumber : __expectString ( output . modelVersionNumber ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1CreateRuleResult = ( output , context ) : CreateRuleResult => { return { rule : output . rule !== undefined && output . rule !== null ? deserializeAws_json1_1Rule ( output . rule , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateVariableResult = ( output , context ) : CreateVariableResult => { return { } as any ; } ; const deserializeAws_json1_1CsvIndexToVariableMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1DataValidationMetrics = ( output , context ) : DataValidationMetrics => { return { fieldLevelMessages : output . fieldLevelMessages !== undefined && output . fieldLevelMessages !== null ? deserializeAws_json1_1fieldValidationMessageList ( output . fieldLevelMessages , context ) : undefined , fileLevelMessages : output . fileLevelMessages !== undefined && output . fileLevelMessages !== null ? deserializeAws_json1_1fileValidationMessageList ( output . fileLevelMessages , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DeleteBatchImportJobResult = ( output , context ) : DeleteBatchImportJobResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteBatchPredictionJobResult = ( output , context ) : DeleteBatchPredictionJobResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteDetectorResult = ( output , context ) : DeleteDetectorResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteDetectorVersionResult = ( output , context ) : DeleteDetectorVersionResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteEntityTypeResult = ( output , context ) : DeleteEntityTypeResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteEventResult = ( output , context ) : DeleteEventResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteEventsByEventTypeResult = ( output , context ) : DeleteEventsByEventTypeResult => { return { eventTypeName : __expectString ( output . eventTypeName ) , eventsDeletionStatus : __expectString ( output . eventsDeletionStatus ) , } as any ; } ; const deserializeAws_json1_1DeleteEventTypeResult = ( output , context ) : DeleteEventTypeResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteExternalModelResult = ( output , context ) : DeleteExternalModelResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteLabelResult = ( output , context ) : DeleteLabelResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteModelResult = ( output , context ) : DeleteModelResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteModelVersionResult = ( output , context ) : DeleteModelVersionResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteOutcomeResult = ( output , context ) : DeleteOutcomeResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteRuleResult = ( output , context ) : DeleteRuleResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteVariableResult = ( output , context ) : DeleteVariableResult => { return { } as any ; } ; const deserializeAws_json1_1DescribeDetectorResult = ( output , context ) : DescribeDetectorResult => { return { arn : __expectString ( output . arn ) , detectorId : __expectString ( output . detectorId ) , detectorVersionSummaries : output . detectorVersionSummaries !== undefined && output . detectorVersionSummaries !== null ? deserializeAws_json1_1DetectorVersionSummaryList ( output . detectorVersionSummaries , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeModelVersionsResult = ( output , context ) : DescribeModelVersionsResult => { return { modelVersionDetails : output . modelVersionDetails !== undefined && output . modelVersionDetails !== null ? deserializeAws_json1_1modelVersionDetailList ( output . modelVersionDetails , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1Detector = ( output , context ) : Detector => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , detectorId : __expectString ( output . detectorId ) , eventTypeName : __expectString ( output . eventTypeName ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , } as any ; } ; const deserializeAws_json1_1DetectorList = ( output , context ) : Detector [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Detector ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DetectorVersionSummary = ( output , context ) : DetectorVersionSummary => { return { description : __expectString ( output . description ) , detectorVersionId : __expectString ( output . detectorVersionId ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1DetectorVersionSummaryList = ( output , context ) : DetectorVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DetectorVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Entity = ( output , context ) : Entity => { return { entityId : __expectString ( output . entityId ) , entityType : __expectString ( output . entityType ) , } as any ; } ; const deserializeAws_json1_1EntityType = ( output , context ) : EntityType => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1entityTypeList = ( output , context ) : EntityType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EntityType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Event = ( output , context ) : Event => { return { currentLabel : __expectString ( output . currentLabel ) , entities : output . entities !== undefined && output . entities !== null ? deserializeAws_json1_1listOfEntities ( output . entities , context ) : undefined , eventId : __expectString ( output . eventId ) , eventTimestamp : __expectString ( output . eventTimestamp ) , eventTypeName : __expectString ( output . eventTypeName ) , eventVariables : output . eventVariables !== undefined && output . eventVariables !== null ? deserializeAws_json1_1EventAttributeMap ( output . eventVariables , context ) : undefined , labelTimestamp : __expectString ( output . labelTimestamp ) , } as any ; } ; const deserializeAws_json1_1EventAttributeMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1EventType = ( output , context ) : EventType => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , entityTypes : output . entityTypes !== undefined && output . entityTypes !== null ? deserializeAws_json1_1NonEmptyListOfStrings ( output . entityTypes , context ) : undefined , eventIngestion : __expectString ( output . eventIngestion ) , eventVariables : output . eventVariables !== undefined && output . eventVariables !== null ? deserializeAws_json1_1ListOfStrings ( output . eventVariables , context ) : undefined , ingestedEventStatistics : output . ingestedEventStatistics !== undefined && output . ingestedEventStatistics !== null ? deserializeAws_json1_1IngestedEventStatistics ( output . ingestedEventStatistics , context ) : undefined , labels : output . labels !== undefined && output . labels !== null ? deserializeAws_json1_1ListOfStrings ( output . labels , context ) : undefined , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1eventTypeList = ( output , context ) : EventType [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EventType ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ExternalEventsDetail = ( output , context ) : ExternalEventsDetail => { return { dataAccessRoleArn : __expectString ( output . dataAccessRoleArn ) , dataLocation : __expectString ( output . dataLocation ) , } as any ; } ; const deserializeAws_json1_1ExternalModel = ( output , context ) : ExternalModel => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , inputConfiguration : output . inputConfiguration !== undefined && output . inputConfiguration !== null ? deserializeAws_json1_1ModelInputConfiguration ( output . inputConfiguration , context ) : undefined , invokeModelEndpointRoleArn : __expectString ( output . invokeModelEndpointRoleArn ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , modelEndpoint : __expectString ( output . modelEndpoint ) , modelEndpointStatus : __expectString ( output . modelEndpointStatus ) , modelSource : __expectString ( output . modelSource ) , outputConfiguration : output . outputConfiguration !== undefined && output . outputConfiguration !== null ? deserializeAws_json1_1ModelOutputConfiguration ( output . outputConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ExternalModelList = ( output , context ) : ExternalModel [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ExternalModel ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ExternalModelOutputs = ( output , context ) : ExternalModelOutputs => { return { externalModel : output . externalModel !== undefined && output . externalModel !== null ? deserializeAws_json1_1ExternalModelSummary ( output . externalModel , context ) : undefined , outputs : output . outputs !== undefined && output . outputs !== null ? deserializeAws_json1_1ExternalModelPredictionMap ( output . outputs , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ExternalModelPredictionMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1ExternalModelSummary = ( output , context ) : ExternalModelSummary => { return { modelEndpoint : __expectString ( output . modelEndpoint ) , modelSource : __expectString ( output . modelSource ) , } as any ; } ; const deserializeAws_json1_1FieldValidationMessage = ( output , context ) : FieldValidationMessage => { return { content : __expectString ( output . content ) , fieldName : __expectString ( output . fieldName ) , identifier : __expectString ( output . identifier ) , title : __expectString ( output . title ) , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_1fieldValidationMessageList = ( output , context ) : FieldValidationMessage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FieldValidationMessage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FileValidationMessage = ( output , context ) : FileValidationMessage => { return { content : __expectString ( output . content ) , title : __expectString ( output . title ) , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_1fileValidationMessageList = ( output , context ) : FileValidationMessage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FileValidationMessage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GetBatchImportJobsResult = ( output , context ) : GetBatchImportJobsResult => { return { batchImports : output . batchImports !== undefined && output . batchImports !== null ? deserializeAws_json1_1BatchImportList ( output . batchImports , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetBatchPredictionJobsResult = ( output , context ) : GetBatchPredictionJobsResult => { return { batchPredictions : output . batchPredictions !== undefined && output . batchPredictions !== null ? deserializeAws_json1_1BatchPredictionList ( output . batchPredictions , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetDeleteEventsByEventTypeStatusResult = ( output , context ) : GetDeleteEventsByEventTypeStatusResult => { return { eventTypeName : __expectString ( output . eventTypeName ) , eventsDeletionStatus : __expectString ( output . eventsDeletionStatus ) , } as any ; } ; const deserializeAws_json1_1GetDetectorsResult = ( output , context ) : GetDetectorsResult => { return { detectors : output . detectors !== undefined && output . detectors !== null ? deserializeAws_json1_1DetectorList ( output . detectors , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetDetectorVersionResult = ( output , context ) : GetDetectorVersionResult => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , detectorId : __expectString ( output . detectorId ) , detectorVersionId : __expectString ( output . detectorVersionId ) , externalModelEndpoints : output . externalModelEndpoints !== undefined && output . externalModelEndpoints !== null ? deserializeAws_json1_1ListOfStrings ( output . externalModelEndpoints , context ) : undefined , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , modelVersions : output . modelVersions !== undefined && output . modelVersions !== null ? deserializeAws_json1_1ListOfModelVersions ( output . modelVersions , context ) : undefined , ruleExecutionMode : __expectString ( output . ruleExecutionMode ) , rules : output . rules !== undefined && output . rules !== null ? deserializeAws_json1_1RuleList ( output . rules , context ) : undefined , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1GetEntityTypesResult = ( output , context ) : GetEntityTypesResult => { return { entityTypes : output . entityTypes !== undefined && output . entityTypes !== null ? deserializeAws_json1_1entityTypeList ( output . entityTypes , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetEventPredictionResult = ( output , context ) : GetEventPredictionResult => { return { externalModelOutputs : output . externalModelOutputs !== undefined && output . externalModelOutputs !== null ? deserializeAws_json1_1ListOfExternalModelOutputs ( output . externalModelOutputs , context ) : undefined , modelScores : output . modelScores !== undefined && output . modelScores !== null ? deserializeAws_json1_1ListOfModelScores ( output . modelScores , context ) : undefined , ruleResults : output . ruleResults !== undefined && output . ruleResults !== null ? deserializeAws_json1_1ListOfRuleResults ( output . ruleResults , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetEventResult = ( output , context ) : GetEventResult => { return { event : output . event !== undefined && output . event !== null ? deserializeAws_json1_1Event ( output . event , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetEventTypesResult = ( output , context ) : GetEventTypesResult => { return { eventTypes : output . eventTypes !== undefined && output . eventTypes !== null ? deserializeAws_json1_1eventTypeList ( output . eventTypes , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetExternalModelsResult = ( output , context ) : GetExternalModelsResult => { return { externalModels : output . externalModels !== undefined && output . externalModels !== null ? deserializeAws_json1_1ExternalModelList ( output . externalModels , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetKMSEncryptionKeyResult = ( output , context ) : GetKMSEncryptionKeyResult => { return { kmsKey : output . kmsKey !== undefined && output . kmsKey !== null ? deserializeAws_json1_1KMSKey ( output . kmsKey , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLabelsResult = ( output , context ) : GetLabelsResult => { return { labels : output . labels !== undefined && output . labels !== null ? deserializeAws_json1_1labelList ( output . labels , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetModelsResult = ( output , context ) : GetModelsResult => { return { models : output . models !== undefined && output . models !== null ? deserializeAws_json1_1modelList ( output . models , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1GetModelVersionResult = ( output , context ) : GetModelVersionResult => { return { arn : __expectString ( output . arn ) , externalEventsDetail : output . externalEventsDetail !== undefined && output . externalEventsDetail !== null ? deserializeAws_json1_1ExternalEventsDetail ( output . externalEventsDetail , context ) : undefined , ingestedEventsDetail : output . ingestedEventsDetail !== undefined && output . ingestedEventsDetail !== null ? deserializeAws_json1_1IngestedEventsDetail ( output . ingestedEventsDetail , context ) : undefined , modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , modelVersionNumber : __expectString ( output . modelVersionNumber ) , status : __expectString ( output . status ) , trainingDataSchema : output . trainingDataSchema !== undefined && output . trainingDataSchema !== null ? deserializeAws_json1_1TrainingDataSchema ( output . trainingDataSchema , context ) : undefined , trainingDataSource : __expectString ( output . trainingDataSource ) , } as any ; } ; const deserializeAws_json1_1GetOutcomesResult = ( output , context ) : GetOutcomesResult => { return { nextToken : __expectString ( output . nextToken ) , outcomes : output . outcomes !== undefined && output . outcomes !== null ? deserializeAws_json1_1OutcomeList ( output . outcomes , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetRulesResult = ( output , context ) : GetRulesResult => { return { nextToken : __expectString ( output . nextToken ) , ruleDetails : output . ruleDetails !== undefined && output . ruleDetails !== null ? deserializeAws_json1_1RuleDetailList ( output . ruleDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetVariablesResult = ( output , context ) : GetVariablesResult => { return { nextToken : __expectString ( output . nextToken ) , variables : output . variables !== undefined && output . variables !== null ? deserializeAws_json1_1VariableList ( output . variables , context ) : undefined , } as any ; } ; const deserializeAws_json1_1IngestedEventsDetail = ( output , context ) : IngestedEventsDetail => { return { ingestedEventsTimeWindow : output . ingestedEventsTimeWindow !== undefined && output . ingestedEventsTimeWindow !== null ? deserializeAws_json1_1IngestedEventsTimeWindow ( output . ingestedEventsTimeWindow , context ) : undefined , } as any ; } ; const deserializeAws_json1_1IngestedEventStatistics = ( output , context ) : IngestedEventStatistics => { return { eventDataSizeInBytes : __expectLong ( output . eventDataSizeInBytes ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , leastRecentEvent : __expectString ( output . leastRecentEvent ) , mostRecentEvent : __expectString ( output . mostRecentEvent ) , numberOfEvents : __expectLong ( output . numberOfEvents ) , } as any ; } ; const deserializeAws_json1_1IngestedEventsTimeWindow = ( output , context ) : IngestedEventsTimeWindow => { return { endTime : __expectString ( output . endTime ) , startTime : __expectString ( output . startTime ) , } as any ; } ; const deserializeAws_json1_1InternalServerException = ( output , context ) : InternalServerException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1JsonKeyToVariableMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1KMSKey = ( output , context ) : KMSKey => { return { kmsEncryptionKeyArn : __expectString ( output . kmsEncryptionKeyArn ) , } as any ; } ; const deserializeAws_json1_1Label = ( output , context ) : Label => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1labelList = ( output , context ) : Label [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Label ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1labelMapper = ( output , context ) : { [ key ] : string [ ] ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_1NonEmptyListOfStrings ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_1LabelSchema = ( output , context ) : LabelSchema => { return { labelMapper : output . labelMapper !== undefined && output . labelMapper !== null ? deserializeAws_json1_1labelMapper ( output . labelMapper , context ) : undefined , unlabeledEventsTreatment : __expectString ( output . unlabeledEventsTreatment ) , } as any ; } ; const deserializeAws_json1_1listOfEntities = ( output , context ) : Entity [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Entity ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfExternalModelOutputs = ( output , context ) : ExternalModelOutputs [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ExternalModelOutputs ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfLogOddsMetrics = ( output , context ) : LogOddsMetric [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LogOddsMetric ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfModelScores = ( output , context ) : ModelScores [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ModelScores ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfModelVersions = ( output , context ) : ModelVersion [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ModelVersion ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfRuleResults = ( output , context ) : RuleResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RuleResult ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListOfStrings = ( 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_1ListTagsForResourceResult = ( output , context ) : ListTagsForResourceResult => { return { nextToken : __expectString ( output . nextToken ) , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_json1_1tagList ( output . tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1LogOddsMetric = ( output , context ) : LogOddsMetric => { return { variableImportance : __limitedParseFloat32 ( output . variableImportance ) , variableName : __expectString ( output . variableName ) , variableType : __expectString ( output . variableType ) , } as any ; } ; const deserializeAws_json1_1MetricDataPoint = ( output , context ) : MetricDataPoint => { return { fpr : __limitedParseFloat32 ( output . fpr ) , precision : __limitedParseFloat32 ( output . precision ) , threshold : __limitedParseFloat32 ( output . threshold ) , tpr : __limitedParseFloat32 ( output . tpr ) , } as any ; } ; const deserializeAws_json1_1metricDataPointsList = ( output , context ) : MetricDataPoint [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1MetricDataPoint ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Model = ( output , context ) : Model => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , eventTypeName : __expectString ( output . eventTypeName ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , } as any ; } ; const deserializeAws_json1_1ModelInputConfiguration = ( output , context ) : ModelInputConfiguration => { return { csvInputTemplate : __expectString ( output . csvInputTemplate ) , eventTypeName : __expectString ( output . eventTypeName ) , format : __expectString ( output . format ) , jsonInputTemplate : __expectString ( output . jsonInputTemplate ) , useEventVariables : __expectBoolean ( output . useEventVariables ) , } as any ; } ; const deserializeAws_json1_1modelList = ( output , context ) : Model [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Model ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ModelOutputConfiguration = ( output , context ) : ModelOutputConfiguration => { return { csvIndexToVariableMap : output . csvIndexToVariableMap !== undefined && output . csvIndexToVariableMap !== null ? deserializeAws_json1_1CsvIndexToVariableMap ( output . csvIndexToVariableMap , context ) : undefined , format : __expectString ( output . format ) , jsonKeyToVariableMap : output . jsonKeyToVariableMap !== undefined && output . jsonKeyToVariableMap !== null ? deserializeAws_json1_1JsonKeyToVariableMap ( output . jsonKeyToVariableMap , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ModelPredictionMap = ( output , context ) : { [ key ] : number ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __limitedParseFloat32 ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1ModelScores = ( output , context ) : ModelScores => { return { modelVersion : output . modelVersion !== undefined && output . modelVersion !== null ? deserializeAws_json1_1ModelVersion ( output . modelVersion , context ) : undefined , scores : output . scores !== undefined && output . scores !== null ? deserializeAws_json1_1ModelPredictionMap ( output . scores , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ModelVersion = ( output , context ) : ModelVersion => { return { arn : __expectString ( output . arn ) , modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , modelVersionNumber : __expectString ( output . modelVersionNumber ) , } as any ; } ; const deserializeAws_json1_1ModelVersionDetail = ( output , context ) : ModelVersionDetail => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , externalEventsDetail : output . externalEventsDetail !== undefined && output . externalEventsDetail !== null ? deserializeAws_json1_1ExternalEventsDetail ( output . externalEventsDetail , context ) : undefined , ingestedEventsDetail : output . ingestedEventsDetail !== undefined && output . ingestedEventsDetail !== null ? deserializeAws_json1_1IngestedEventsDetail ( output . ingestedEventsDetail , context ) : undefined , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , modelVersionNumber : __expectString ( output . modelVersionNumber ) , status : __expectString ( output . status ) , trainingDataSchema : output . trainingDataSchema !== undefined && output . trainingDataSchema !== null ? deserializeAws_json1_1TrainingDataSchema ( output . trainingDataSchema , context ) : undefined , trainingDataSource : __expectString ( output . trainingDataSource ) , trainingResult : output . trainingResult !== undefined && output . trainingResult !== null ? deserializeAws_json1_1TrainingResult ( output . trainingResult , context ) : undefined , } as any ; } ; const deserializeAws_json1_1modelVersionDetailList = ( output , context ) : ModelVersionDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ModelVersionDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1NonEmptyListOfStrings = ( 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_1Outcome = ( output , context ) : Outcome => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , name : __expectString ( output . name ) , } as any ; } ; const deserializeAws_json1_1OutcomeList = ( output , context ) : Outcome [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Outcome ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PutDetectorResult = ( output , context ) : PutDetectorResult => { return { } as any ; } ; const deserializeAws_json1_1PutEntityTypeResult = ( output , context ) : PutEntityTypeResult => { return { } as any ; } ; const deserializeAws_json1_1PutEventTypeResult = ( output , context ) : PutEventTypeResult => { return { } as any ; } ; const deserializeAws_json1_1PutExternalModelResult = ( output , context ) : PutExternalModelResult => { return { } as any ; } ; const deserializeAws_json1_1PutKMSEncryptionKeyResult = ( output , context ) : PutKMSEncryptionKeyResult => { return { } as any ; } ; const deserializeAws_json1_1PutLabelResult = ( output , context ) : PutLabelResult => { return { } as any ; } ; const deserializeAws_json1_1PutOutcomeResult = ( output , context ) : PutOutcomeResult => { return { } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceUnavailableException = ( output , context ) : ResourceUnavailableException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1Rule = ( output , context ) : Rule => { return { detectorId : __expectString ( output . detectorId ) , ruleId : __expectString ( output . ruleId ) , ruleVersion : __expectString ( output . ruleVersion ) , } as any ; } ; const deserializeAws_json1_1RuleDetail = ( output , context ) : RuleDetail => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , description : __expectString ( output . description ) , detectorId : __expectString ( output . detectorId ) , expression : __expectString ( output . expression ) , language : __expectString ( output . language ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , outcomes : output . outcomes !== undefined && output . outcomes !== null ? deserializeAws_json1_1NonEmptyListOfStrings ( output . outcomes , context ) : undefined , ruleId : __expectString ( output . ruleId ) , ruleVersion : __expectString ( output . ruleVersion ) , } as any ; } ; const deserializeAws_json1_1RuleDetailList = ( output , context ) : RuleDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RuleDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RuleList = ( output , context ) : Rule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Rule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RuleResult = ( output , context ) : RuleResult => { return { outcomes : output . outcomes !== undefined && output . outcomes !== null ? deserializeAws_json1_1ListOfStrings ( output . outcomes , context ) : undefined , ruleId : __expectString ( output . ruleId ) , } as any ; } ; const deserializeAws_json1_1SendEventResult = ( output , context ) : SendEventResult => { return { } as any ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { key : __expectString ( output . key ) , value : __expectString ( output . value ) , } as any ; } ; const deserializeAws_json1_1tagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TagResourceResult = ( output , context ) : TagResourceResult => { return { } as any ; } ; const deserializeAws_json1_1ThrottlingException = ( output , context ) : ThrottlingException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1TrainingDataSchema = ( output , context ) : TrainingDataSchema => { return { labelSchema : output . labelSchema !== undefined && output . labelSchema !== null ? deserializeAws_json1_1LabelSchema ( output . labelSchema , context ) : undefined , modelVariables : output . modelVariables !== undefined && output . modelVariables !== null ? deserializeAws_json1_1ListOfStrings ( output . modelVariables , context ) : undefined , } as any ; } ; const deserializeAws_json1_1TrainingMetrics = ( output , context ) : TrainingMetrics => { return { auc : __limitedParseFloat32 ( output . auc ) , metricDataPoints : output . metricDataPoints !== undefined && output . metricDataPoints !== null ? deserializeAws_json1_1metricDataPointsList ( output . metricDataPoints , context ) : undefined , } as any ; } ; const deserializeAws_json1_1TrainingResult = ( output , context ) : TrainingResult => { return { dataValidationMetrics : output . dataValidationMetrics !== undefined && output . dataValidationMetrics !== null ? deserializeAws_json1_1DataValidationMetrics ( output . dataValidationMetrics , context ) : undefined , trainingMetrics : output . trainingMetrics !== undefined && output . trainingMetrics !== null ? deserializeAws_json1_1TrainingMetrics ( output . trainingMetrics , context ) : undefined , variableImportanceMetrics : output . variableImportanceMetrics !== undefined && output . variableImportanceMetrics !== null ? deserializeAws_json1_1VariableImportanceMetrics ( output . variableImportanceMetrics , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UntagResourceResult = ( output , context ) : UntagResourceResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateDetectorVersionMetadataResult = ( output , context ) : UpdateDetectorVersionMetadataResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateDetectorVersionResult = ( output , context ) : UpdateDetectorVersionResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateDetectorVersionStatusResult = ( output , context ) : UpdateDetectorVersionStatusResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateEventLabelResult = ( output , context ) : UpdateEventLabelResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateModelResult = ( output , context ) : UpdateModelResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateModelVersionResult = ( output , context ) : UpdateModelVersionResult => { return { modelId : __expectString ( output . modelId ) , modelType : __expectString ( output . modelType ) , modelVersionNumber : __expectString ( output . modelVersionNumber ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1UpdateModelVersionStatusResult = ( output , context ) : UpdateModelVersionStatusResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateRuleMetadataResult = ( output , context ) : UpdateRuleMetadataResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateRuleVersionResult = ( output , context ) : UpdateRuleVersionResult => { return { rule : output . rule !== undefined && output . rule !== null ? deserializeAws_json1_1Rule ( output . rule , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateVariableResult = ( output , context ) : UpdateVariableResult => { return { } as any ; } ; const deserializeAws_json1_1ValidationException = ( output , context ) : ValidationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1Variable = ( output , context ) : Variable => { return { arn : __expectString ( output . arn ) , createdTime : __expectString ( output . createdTime ) , dataSource : __expectString ( output . dataSource ) , dataType : __expectString ( output . dataType ) , defaultValue : __expectString ( output . defaultValue ) , description : __expectString ( output . description ) , lastUpdatedTime : __expectString ( output . lastUpdatedTime ) , name : __expectString ( output . name ) , variableType : __expectString ( output . variableType ) , } as any ; } ; const deserializeAws_json1_1VariableImportanceMetrics = ( output , context ) : VariableImportanceMetrics => { return { logOddsMetrics : output . logOddsMetrics !== undefined && output . logOddsMetrics !== null ? deserializeAws_json1_1ListOfLogOddsMetrics ( output . logOddsMetrics , context ) : undefined , } as any ; } ; const deserializeAws_json1_1VariableList = ( output , context ) : Variable [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Variable ( entry , context ) ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { 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 "" ; } ;