import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { v4 as generateIdempotencyToken } from "uuid" ; import { AssociateConfigurationItemsToApplicationCommandInput , AssociateConfigurationItemsToApplicationCommandOutput , } from "../commands/AssociateConfigurationItemsToApplicationCommand" ; import { BatchDeleteImportDataCommandInput , BatchDeleteImportDataCommandOutput , } from "../commands/BatchDeleteImportDataCommand" ; import { CreateApplicationCommandInput , CreateApplicationCommandOutput } from "../commands/CreateApplicationCommand" ; import { CreateTagsCommandInput , CreateTagsCommandOutput } from "../commands/CreateTagsCommand" ; import { DeleteApplicationsCommandInput , DeleteApplicationsCommandOutput } from "../commands/DeleteApplicationsCommand" ; import { DeleteTagsCommandInput , DeleteTagsCommandOutput } from "../commands/DeleteTagsCommand" ; import { DescribeAgentsCommandInput , DescribeAgentsCommandOutput } from "../commands/DescribeAgentsCommand" ; import { DescribeConfigurationsCommandInput , DescribeConfigurationsCommandOutput , } from "../commands/DescribeConfigurationsCommand" ; import { DescribeContinuousExportsCommandInput , DescribeContinuousExportsCommandOutput , } from "../commands/DescribeContinuousExportsCommand" ; import { DescribeExportConfigurationsCommandInput , DescribeExportConfigurationsCommandOutput , } from "../commands/DescribeExportConfigurationsCommand" ; import { DescribeExportTasksCommandInput , DescribeExportTasksCommandOutput , } from "../commands/DescribeExportTasksCommand" ; import { DescribeImportTasksCommandInput , DescribeImportTasksCommandOutput , } from "../commands/DescribeImportTasksCommand" ; import { DescribeTagsCommandInput , DescribeTagsCommandOutput } from "../commands/DescribeTagsCommand" ; import { DisassociateConfigurationItemsFromApplicationCommandInput , DisassociateConfigurationItemsFromApplicationCommandOutput , } from "../commands/DisassociateConfigurationItemsFromApplicationCommand" ; import { ExportConfigurationsCommandInput , ExportConfigurationsCommandOutput , } from "../commands/ExportConfigurationsCommand" ; import { GetDiscoverySummaryCommandInput , GetDiscoverySummaryCommandOutput , } from "../commands/GetDiscoverySummaryCommand" ; import { ListConfigurationsCommandInput , ListConfigurationsCommandOutput } from "../commands/ListConfigurationsCommand" ; import { ListServerNeighborsCommandInput , ListServerNeighborsCommandOutput , } from "../commands/ListServerNeighborsCommand" ; import { StartContinuousExportCommandInput , StartContinuousExportCommandOutput , } from "../commands/StartContinuousExportCommand" ; import { StartDataCollectionByAgentIdsCommandInput , StartDataCollectionByAgentIdsCommandOutput , } from "../commands/StartDataCollectionByAgentIdsCommand" ; import { StartExportTaskCommandInput , StartExportTaskCommandOutput } from "../commands/StartExportTaskCommand" ; import { StartImportTaskCommandInput , StartImportTaskCommandOutput } from "../commands/StartImportTaskCommand" ; import { StopContinuousExportCommandInput , StopContinuousExportCommandOutput , } from "../commands/StopContinuousExportCommand" ; import { StopDataCollectionByAgentIdsCommandInput , StopDataCollectionByAgentIdsCommandOutput , } from "../commands/StopDataCollectionByAgentIdsCommand" ; import { UpdateApplicationCommandInput , UpdateApplicationCommandOutput } from "../commands/UpdateApplicationCommand" ; import { AgentConfigurationStatus , AgentInfo , AgentNetworkInfo , AssociateConfigurationItemsToApplicationRequest , AssociateConfigurationItemsToApplicationResponse , AuthorizationErrorException , BatchDeleteImportDataError , BatchDeleteImportDataRequest , BatchDeleteImportDataResponse , ConfigurationTag , ConflictErrorException , ContinuousExportDescription , CreateApplicationRequest , CreateApplicationResponse , CreateTagsRequest , CreateTagsResponse , CustomerAgentInfo , CustomerConnectorInfo , DeleteApplicationsRequest , DeleteApplicationsResponse , DeleteTagsRequest , DeleteTagsResponse , DescribeAgentsRequest , DescribeAgentsResponse , DescribeConfigurationsRequest , DescribeConfigurationsResponse , DescribeContinuousExportsRequest , DescribeContinuousExportsResponse , DescribeExportConfigurationsRequest , DescribeExportConfigurationsResponse , DescribeExportTasksRequest , DescribeExportTasksResponse , DescribeImportTasksRequest , DescribeImportTasksResponse , DescribeTagsRequest , DescribeTagsResponse , DisassociateConfigurationItemsFromApplicationRequest , DisassociateConfigurationItemsFromApplicationResponse , ExportConfigurationsResponse , ExportDataFormat , ExportFilter , ExportInfo , Filter , GetDiscoverySummaryRequest , GetDiscoverySummaryResponse , HomeRegionNotSetException , ImportTask , ImportTaskFilter , InvalidParameterException , InvalidParameterValueException , ListConfigurationsRequest , ListConfigurationsResponse , ListServerNeighborsRequest , ListServerNeighborsResponse , NeighborConnectionDetail , OperationNotPermittedException , OrderByElement , ResourceInUseException , ResourceNotFoundException , ServerInternalErrorException , StartContinuousExportRequest , StartContinuousExportResponse , StartDataCollectionByAgentIdsRequest , StartDataCollectionByAgentIdsResponse , StartExportTaskRequest , StartExportTaskResponse , StartImportTaskRequest , StartImportTaskResponse , StopContinuousExportRequest , StopContinuousExportResponse , StopDataCollectionByAgentIdsRequest , StopDataCollectionByAgentIdsResponse , Tag , TagFilter , UpdateApplicationRequest , UpdateApplicationResponse , } from "../models/models_0" ; export const serializeAws_json1_1AssociateConfigurationItemsToApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.AssociateConfigurationItemsToApplication" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1BatchDeleteImportDataCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.BatchDeleteImportData" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchDeleteImportDataRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.CreateApplication" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateApplicationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.CreateTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteApplicationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DeleteApplications" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteApplicationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DeleteTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAgentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeAgents" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAgentsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeConfigurations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeConfigurationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeContinuousExportsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeContinuousExports" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeContinuousExportsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeExportConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeExportConfigurations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeExportConfigurationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeExportTasksCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeExportTasks" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeExportTasksRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeImportTasksCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeImportTasks" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeImportTasksRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DescribeTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.DisassociateConfigurationItemsFromApplication" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DisassociateConfigurationItemsFromApplicationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ExportConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.ExportConfigurations" , } ; const body = "{}" ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDiscoverySummaryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.GetDiscoverySummary" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDiscoverySummaryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.ListConfigurations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListConfigurationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListServerNeighborsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.ListServerNeighbors" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListServerNeighborsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartContinuousExportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StartContinuousExport" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartContinuousExportRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartDataCollectionByAgentIdsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StartDataCollectionByAgentIds" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartDataCollectionByAgentIdsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartExportTaskCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StartExportTask" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartExportTaskRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartImportTaskCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StartImportTask" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartImportTaskRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopContinuousExportCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StopContinuousExport" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopContinuousExportRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopDataCollectionByAgentIdsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.StopDataCollectionByAgentIds" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopDataCollectionByAgentIdsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateApplicationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSPoseidonService_V2015_11_01.UpdateApplication" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateApplicationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommand = async ( output , context ) : Promise < AssociateConfigurationItemsToApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AssociateConfigurationItemsToApplicationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AssociateConfigurationItemsToApplicationCommandError = async ( output , context ) : Promise < AssociateConfigurationItemsToApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1BatchDeleteImportDataCommand = async ( output , context ) : Promise < BatchDeleteImportDataCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchDeleteImportDataCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchDeleteImportDataResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchDeleteImportDataCommandError = async ( output , context ) : Promise < BatchDeleteImportDataCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1CreateApplicationCommand = async ( output , context ) : Promise < CreateApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateApplicationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateApplicationCommandError = async ( output , context ) : Promise < CreateApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1CreateTagsCommand = async ( output , context ) : Promise < CreateTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateTagsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateTagsCommandError = async ( output , context ) : Promise < CreateTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteApplicationsCommand = async ( output , context ) : Promise < DeleteApplicationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteApplicationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteApplicationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteApplicationsCommandError = async ( output , context ) : Promise < DeleteApplicationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteTagsCommand = async ( output , context ) : Promise < DeleteTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteTagsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteTagsCommandError = async ( output , context ) : Promise < DeleteTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeAgentsCommand = async ( output , context ) : Promise < DescribeAgentsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAgentsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAgentsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAgentsCommandError = async ( output , context ) : Promise < DescribeAgentsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeConfigurationsCommand = async ( output , context ) : Promise < DescribeConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeConfigurationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeConfigurationsCommandError = async ( output , context ) : Promise < DescribeConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeContinuousExportsCommand = async ( output , context ) : Promise < DescribeContinuousExportsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeContinuousExportsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeContinuousExportsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeContinuousExportsCommandError = async ( output , context ) : Promise < DescribeContinuousExportsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotPermittedException" : case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException" : response = { ... ( await deserializeAws_json1_1OperationNotPermittedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeExportConfigurationsCommand = async ( output , context ) : Promise < DescribeExportConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeExportConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeExportConfigurationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeExportConfigurationsCommandError = async ( output , context ) : Promise < DescribeExportConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeExportTasksCommand = async ( output , context ) : Promise < DescribeExportTasksCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeExportTasksCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeExportTasksResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeExportTasksCommandError = async ( output , context ) : Promise < DescribeExportTasksCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeImportTasksCommand = async ( output , context ) : Promise < DescribeImportTasksCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeImportTasksCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeImportTasksResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeImportTasksCommandError = async ( output , context ) : Promise < DescribeImportTasksCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeTagsCommand = async ( output , context ) : Promise < DescribeTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeTagsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeTagsCommandError = async ( output , context ) : Promise < DescribeTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DisassociateConfigurationItemsFromApplicationCommand = async ( output , context ) : Promise < DisassociateConfigurationItemsFromApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationCommandError = async ( output , context ) : Promise < DisassociateConfigurationItemsFromApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ExportConfigurationsCommand = async ( output , context ) : Promise < ExportConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ExportConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ExportConfigurationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ExportConfigurationsCommandError = async ( output , context ) : Promise < ExportConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotPermittedException" : case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException" : response = { ... ( await deserializeAws_json1_1OperationNotPermittedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetDiscoverySummaryCommand = async ( output , context ) : Promise < GetDiscoverySummaryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDiscoverySummaryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDiscoverySummaryResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDiscoverySummaryCommandError = async ( output , context ) : Promise < GetDiscoverySummaryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListConfigurationsCommand = async ( output , context ) : Promise < ListConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListConfigurationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListConfigurationsCommandError = async ( output , context ) : Promise < ListConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListServerNeighborsCommand = async ( output , context ) : Promise < ListServerNeighborsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListServerNeighborsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListServerNeighborsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListServerNeighborsCommandError = async ( output , context ) : Promise < ListServerNeighborsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StartContinuousExportCommand = async ( output , context ) : Promise < StartContinuousExportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartContinuousExportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartContinuousExportResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartContinuousExportCommandError = async ( output , context ) : Promise < StartContinuousExportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictErrorException" : case "com.amazonaws.applicationdiscoveryservice#ConflictErrorException" : response = { ... ( await deserializeAws_json1_1ConflictErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotPermittedException" : case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException" : response = { ... ( await deserializeAws_json1_1OperationNotPermittedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceInUseException" : case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException" : response = { ... ( await deserializeAws_json1_1ResourceInUseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StartDataCollectionByAgentIdsCommand = async ( output , context ) : Promise < StartDataCollectionByAgentIdsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartDataCollectionByAgentIdsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartDataCollectionByAgentIdsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartDataCollectionByAgentIdsCommandError = async ( output , context ) : Promise < StartDataCollectionByAgentIdsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StartExportTaskCommand = async ( output , context ) : Promise < StartExportTaskCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartExportTaskCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartExportTaskResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartExportTaskCommandError = async ( output , context ) : Promise < StartExportTaskCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotPermittedException" : case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException" : response = { ... ( await deserializeAws_json1_1OperationNotPermittedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StartImportTaskCommand = async ( output , context ) : Promise < StartImportTaskCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartImportTaskCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartImportTaskResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartImportTaskCommandError = async ( output , context ) : Promise < StartImportTaskCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceInUseException" : case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException" : response = { ... ( await deserializeAws_json1_1ResourceInUseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StopContinuousExportCommand = async ( output , context ) : Promise < StopContinuousExportCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopContinuousExportCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopContinuousExportResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopContinuousExportCommandError = async ( output , context ) : Promise < StopContinuousExportCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotPermittedException" : case "com.amazonaws.applicationdiscoveryservice#OperationNotPermittedException" : response = { ... ( await deserializeAws_json1_1OperationNotPermittedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceInUseException" : case "com.amazonaws.applicationdiscoveryservice#ResourceInUseException" : response = { ... ( await deserializeAws_json1_1ResourceInUseExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.applicationdiscoveryservice#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1StopDataCollectionByAgentIdsCommand = async ( output , context ) : Promise < StopDataCollectionByAgentIdsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopDataCollectionByAgentIdsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopDataCollectionByAgentIdsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopDataCollectionByAgentIdsCommandError = async ( output , context ) : Promise < StopDataCollectionByAgentIdsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateApplicationCommand = async ( output , context ) : Promise < UpdateApplicationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateApplicationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateApplicationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateApplicationCommandError = async ( output , context ) : Promise < UpdateApplicationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AuthorizationErrorException" : case "com.amazonaws.applicationdiscoveryservice#AuthorizationErrorException" : response = { ... ( await deserializeAws_json1_1AuthorizationErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "HomeRegionNotSetException" : case "com.amazonaws.applicationdiscoveryservice#HomeRegionNotSetException" : response = { ... ( await deserializeAws_json1_1HomeRegionNotSetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.applicationdiscoveryservice#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalErrorException" : case "com.amazonaws.applicationdiscoveryservice#ServerInternalErrorException" : response = { ... ( await deserializeAws_json1_1ServerInternalErrorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } 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_1AuthorizationErrorExceptionResponse = async ( parsedOutput , context ) : Promise < AuthorizationErrorException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AuthorizationErrorException ( body , context ) ; const contents = { name : "AuthorizationErrorException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ConflictErrorExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictErrorException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConflictErrorException ( body , context ) ; const contents = { name : "ConflictErrorException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1HomeRegionNotSetExceptionResponse = async ( parsedOutput , context ) : Promise < HomeRegionNotSetException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1HomeRegionNotSetException ( body , context ) ; const contents = { name : "HomeRegionNotSetException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterException ( body , context ) ; const contents = { name : "InvalidParameterException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterValueExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterValueException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterValueException ( body , context ) ; const contents = { name : "InvalidParameterValueException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1OperationNotPermittedExceptionResponse = async ( parsedOutput , context ) : Promise < OperationNotPermittedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1OperationNotPermittedException ( body , context ) ; const contents = { name : "OperationNotPermittedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceInUseExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceInUseException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceInUseException ( body , context ) ; const contents = { name : "ResourceInUseException" , $fault : "client" , $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_1ServerInternalErrorExceptionResponse = async ( parsedOutput , context ) : Promise < ServerInternalErrorException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ServerInternalErrorException ( body , context ) ; const contents = { name : "ServerInternalErrorException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AgentIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ApplicationIdsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1AssociateConfigurationItemsToApplicationRequest = ( input , context ) : any => { return { ... ( input . applicationConfigurationId !== undefined && input . applicationConfigurationId !== null && { applicationConfigurationId : input . applicationConfigurationId } ) , ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ConfigurationIdList ( input . configurationIds , context ) , } ) , } ; } ; const serializeAws_json1_1BatchDeleteImportDataRequest = ( input , context ) : any => { return { ... ( input . importTaskIds !== undefined && input . importTaskIds !== null && { importTaskIds : serializeAws_json1_1ToDeleteIdentifierList ( input . importTaskIds , context ) , } ) , } ; } ; const serializeAws_json1_1ConfigurationIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ContinuousExportIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1CreateApplicationRequest = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1CreateTagsRequest = ( input , context ) : any => { return { ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ConfigurationIdList ( input . configurationIds , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1TagSet ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1DeleteApplicationsRequest = ( input , context ) : any => { return { ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ApplicationIdsList ( input . configurationIds , context ) , } ) , } ; } ; const serializeAws_json1_1DeleteTagsRequest = ( input , context ) : any => { return { ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ConfigurationIdList ( input . configurationIds , context ) , } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1TagSet ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1DescribeAgentsRequest = ( input , context ) : any => { return { ... ( input . agentIds !== undefined && input . agentIds !== null && { agentIds : serializeAws_json1_1AgentIds ( input . agentIds , context ) } ) , ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeConfigurationsRequest = ( input , context ) : any => { return { ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ConfigurationIdList ( input . configurationIds , context ) , } ) , } ; } ; const serializeAws_json1_1DescribeContinuousExportsRequest = ( input , context ) : any => { return { ... ( input . exportIds !== undefined && input . exportIds !== null && { exportIds : serializeAws_json1_1ContinuousExportIds ( input . exportIds , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeExportConfigurationsRequest = ( input , context ) : any => { return { ... ( input . exportIds !== undefined && input . exportIds !== null && { exportIds : serializeAws_json1_1ExportIds ( input . exportIds , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeExportTasksRequest = ( input , context ) : any => { return { ... ( input . exportIds !== undefined && input . exportIds !== null && { exportIds : serializeAws_json1_1ExportIds ( input . exportIds , context ) } ) , ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1ExportFilters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeImportTasksFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ImportTaskFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1DescribeImportTasksRequest = ( input , context ) : any => { return { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1DescribeImportTasksFilterList ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DescribeTagsRequest = ( input , context ) : any => { return { ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1TagFilters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_1DisassociateConfigurationItemsFromApplicationRequest = ( input , context ) : any => { return { ... ( input . applicationConfigurationId !== undefined && input . applicationConfigurationId !== null && { applicationConfigurationId : input . applicationConfigurationId } ) , ... ( input . configurationIds !== undefined && input . configurationIds !== null && { configurationIds : serializeAws_json1_1ConfigurationIdList ( input . configurationIds , context ) , } ) , } ; } ; const serializeAws_json1_1ExportDataFormats = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ExportFilter = ( input , context ) : any => { return { ... ( input . condition !== undefined && input . condition !== null && { condition : input . condition } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . values !== undefined && input . values !== null && { values : serializeAws_json1_1FilterValues ( input . values , context ) } ) , } ; } ; const serializeAws_json1_1ExportFilters = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ExportFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ExportIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1Filter = ( input , context ) : any => { return { ... ( input . condition !== undefined && input . condition !== null && { condition : input . condition } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . values !== undefined && input . values !== null && { values : serializeAws_json1_1FilterValues ( input . values , context ) } ) , } ; } ; const serializeAws_json1_1Filters = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Filter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1FilterValues = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GetDiscoverySummaryRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1ImportTaskFilter = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . values !== undefined && input . values !== null && { values : serializeAws_json1_1ImportTaskFilterValueList ( input . values , context ) } ) , } ; } ; const serializeAws_json1_1ImportTaskFilterValueList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ListConfigurationsRequest = ( input , context ) : any => { return { ... ( input . configurationType !== undefined && input . configurationType !== null && { configurationType : input . configurationType } ) , ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1Filters ( input . filters , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . orderBy !== undefined && input . orderBy !== null && { orderBy : serializeAws_json1_1OrderByList ( input . orderBy , context ) } ) , } ; } ; const serializeAws_json1_1ListServerNeighborsRequest = ( input , context ) : any => { return { ... ( input . configurationId !== undefined && input . configurationId !== null && { configurationId : input . configurationId } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . neighborConfigurationIds !== undefined && input . neighborConfigurationIds !== null && { neighborConfigurationIds : serializeAws_json1_1ConfigurationIdList ( input . neighborConfigurationIds , context ) , } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . portInformationNeeded !== undefined && input . portInformationNeeded !== null && { portInformationNeeded : input . portInformationNeeded } ) , } ; } ; const serializeAws_json1_1OrderByElement = ( input , context ) : any => { return { ... ( input . fieldName !== undefined && input . fieldName !== null && { fieldName : input . fieldName } ) , ... ( input . sortOrder !== undefined && input . sortOrder !== null && { sortOrder : input . sortOrder } ) , } ; } ; const serializeAws_json1_1OrderByList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1OrderByElement ( entry , context ) ; } ) ; } ; const serializeAws_json1_1StartContinuousExportRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1StartDataCollectionByAgentIdsRequest = ( input , context ) : any => { return { ... ( input . agentIds !== undefined && input . agentIds !== null && { agentIds : serializeAws_json1_1AgentIds ( input . agentIds , context ) } ) , } ; } ; const serializeAws_json1_1StartExportTaskRequest = ( input , context ) : any => { return { ... ( input . endTime !== undefined && input . endTime !== null && { endTime : Math . round ( input . endTime . getTime ( ) / 1000 ) } ) , ... ( input . exportDataFormat !== undefined && input . exportDataFormat !== null && { exportDataFormat : serializeAws_json1_1ExportDataFormats ( input . exportDataFormat , context ) , } ) , ... ( input . filters !== undefined && input . filters !== null && { filters : serializeAws_json1_1ExportFilters ( input . filters , context ) } ) , ... ( input . startTime !== undefined && input . startTime !== null && { startTime : Math . round ( input . startTime . getTime ( ) / 1000 ) } ) , } ; } ; const serializeAws_json1_1StartImportTaskRequest = ( input , context ) : any => { return { clientRequestToken : input . clientRequestToken ?? generateIdempotencyToken ( ) , ... ( input . importUrl !== undefined && input . importUrl !== null && { importUrl : input . importUrl } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_1StopContinuousExportRequest = ( input , context ) : any => { return { ... ( input . exportId !== undefined && input . exportId !== null && { exportId : input . exportId } ) , } ; } ; const serializeAws_json1_1StopDataCollectionByAgentIdsRequest = ( input , context ) : any => { return { ... ( input . agentIds !== undefined && input . agentIds !== null && { agentIds : serializeAws_json1_1AgentIds ( input . agentIds , context ) } ) , } ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . key !== undefined && input . key !== null && { key : input . key } ) , ... ( input . value !== undefined && input . value !== null && { value : input . value } ) , } ; } ; const serializeAws_json1_1TagFilter = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . values !== undefined && input . values !== null && { values : serializeAws_json1_1FilterValues ( input . values , context ) } ) , } ; } ; const serializeAws_json1_1TagFilters = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1TagFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TagSet = ( 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_1ToDeleteIdentifierList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1UpdateApplicationRequest = ( input , context ) : any => { return { ... ( input . configurationId !== undefined && input . configurationId !== null && { configurationId : input . configurationId } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const deserializeAws_json1_1AgentConfigurationStatus = ( output , context ) : AgentConfigurationStatus => { return { agentId : __expectString ( output . agentId ) , description : __expectString ( output . description ) , operationSucceeded : __expectBoolean ( output . operationSucceeded ) , } as any ; } ; const deserializeAws_json1_1AgentConfigurationStatusList = ( output , context ) : AgentConfigurationStatus [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AgentConfigurationStatus ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AgentInfo = ( output , context ) : AgentInfo => { return { agentId : __expectString ( output . agentId ) , agentNetworkInfoList : output . agentNetworkInfoList !== undefined && output . agentNetworkInfoList !== null ? deserializeAws_json1_1AgentNetworkInfoList ( output . agentNetworkInfoList , context ) : undefined , agentType : __expectString ( output . agentType ) , collectionStatus : __expectString ( output . collectionStatus ) , connectorId : __expectString ( output . connectorId ) , health : __expectString ( output . health ) , hostName : __expectString ( output . hostName ) , lastHealthPingTime : __expectString ( output . lastHealthPingTime ) , registeredTime : __expectString ( output . registeredTime ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_json1_1AgentNetworkInfo = ( output , context ) : AgentNetworkInfo => { return { ipAddress : __expectString ( output . ipAddress ) , macAddress : __expectString ( output . macAddress ) , } as any ; } ; const deserializeAws_json1_1AgentNetworkInfoList = ( output , context ) : AgentNetworkInfo [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AgentNetworkInfo ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AgentsInfo = ( output , context ) : AgentInfo [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AgentInfo ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AssociateConfigurationItemsToApplicationResponse = ( output , context ) : AssociateConfigurationItemsToApplicationResponse => { return { } as any ; } ; const deserializeAws_json1_1AuthorizationErrorException = ( output , context ) : AuthorizationErrorException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1BatchDeleteImportDataError = ( output , context ) : BatchDeleteImportDataError => { return { errorCode : __expectString ( output . errorCode ) , errorDescription : __expectString ( output . errorDescription ) , importTaskId : __expectString ( output . importTaskId ) , } as any ; } ; const deserializeAws_json1_1BatchDeleteImportDataErrorList = ( output , context ) : BatchDeleteImportDataError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1BatchDeleteImportDataError ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1BatchDeleteImportDataResponse = ( output , context ) : BatchDeleteImportDataResponse => { return { errors : output . errors !== undefined && output . errors !== null ? deserializeAws_json1_1BatchDeleteImportDataErrorList ( output . errors , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Configuration = ( 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_1Configurations = ( output , context ) : { [ key ] : string ; } [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Configuration ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ConfigurationTag = ( output , context ) : ConfigurationTag => { return { configurationId : __expectString ( output . configurationId ) , configurationType : __expectString ( output . configurationType ) , key : __expectString ( output . key ) , timeOfCreation : output . timeOfCreation !== undefined && output . timeOfCreation !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . timeOfCreation ) ) ) : undefined , value : __expectString ( output . value ) , } as any ; } ; const deserializeAws_json1_1ConfigurationTagSet = ( output , context ) : ConfigurationTag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ConfigurationTag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ConflictErrorException = ( output , context ) : ConflictErrorException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ContinuousExportDescription = ( output , context ) : ContinuousExportDescription => { return { dataSource : __expectString ( output . dataSource ) , exportId : __expectString ( output . exportId ) , s3Bucket : __expectString ( output . s3Bucket ) , schemaStorageConfig : output . schemaStorageConfig !== undefined && output . schemaStorageConfig !== null ? deserializeAws_json1_1SchemaStorageConfig ( output . schemaStorageConfig , context ) : undefined , startTime : output . startTime !== undefined && output . startTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startTime ) ) ) : undefined , status : __expectString ( output . status ) , statusDetail : __expectString ( output . statusDetail ) , stopTime : output . stopTime !== undefined && output . stopTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1ContinuousExportDescriptions = ( output , context ) : ContinuousExportDescription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ContinuousExportDescription ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CreateApplicationResponse = ( output , context ) : CreateApplicationResponse => { return { configurationId : __expectString ( output . configurationId ) , } as any ; } ; const deserializeAws_json1_1CreateTagsResponse = ( output , context ) : CreateTagsResponse => { return { } as any ; } ; const deserializeAws_json1_1CustomerAgentInfo = ( output , context ) : CustomerAgentInfo => { return { activeAgents : __expectInt32 ( output . activeAgents ) , blackListedAgents : __expectInt32 ( output . blackListedAgents ) , healthyAgents : __expectInt32 ( output . healthyAgents ) , shutdownAgents : __expectInt32 ( output . shutdownAgents ) , totalAgents : __expectInt32 ( output . totalAgents ) , unhealthyAgents : __expectInt32 ( output . unhealthyAgents ) , unknownAgents : __expectInt32 ( output . unknownAgents ) , } as any ; } ; const deserializeAws_json1_1CustomerConnectorInfo = ( output , context ) : CustomerConnectorInfo => { return { activeConnectors : __expectInt32 ( output . activeConnectors ) , blackListedConnectors : __expectInt32 ( output . blackListedConnectors ) , healthyConnectors : __expectInt32 ( output . healthyConnectors ) , shutdownConnectors : __expectInt32 ( output . shutdownConnectors ) , totalConnectors : __expectInt32 ( output . totalConnectors ) , unhealthyConnectors : __expectInt32 ( output . unhealthyConnectors ) , unknownConnectors : __expectInt32 ( output . unknownConnectors ) , } as any ; } ; const deserializeAws_json1_1DeleteApplicationsResponse = ( output , context ) : DeleteApplicationsResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteTagsResponse = ( output , context ) : DeleteTagsResponse => { return { } as any ; } ; const deserializeAws_json1_1DescribeAgentsResponse = ( output , context ) : DescribeAgentsResponse => { return { agentsInfo : output . agentsInfo !== undefined && output . agentsInfo !== null ? deserializeAws_json1_1AgentsInfo ( output . agentsInfo , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeConfigurationsAttribute = ( 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_1DescribeConfigurationsAttributes = ( output , context ) : { [ key ] : string ; } [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DescribeConfigurationsAttribute ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DescribeConfigurationsResponse = ( output , context ) : DescribeConfigurationsResponse => { return { configurations : output . configurations !== undefined && output . configurations !== null ? deserializeAws_json1_1DescribeConfigurationsAttributes ( output . configurations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeContinuousExportsResponse = ( output , context ) : DescribeContinuousExportsResponse => { return { descriptions : output . descriptions !== undefined && output . descriptions !== null ? deserializeAws_json1_1ContinuousExportDescriptions ( output . descriptions , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeExportConfigurationsResponse = ( output , context ) : DescribeExportConfigurationsResponse => { return { exportsInfo : output . exportsInfo !== undefined && output . exportsInfo !== null ? deserializeAws_json1_1ExportsInfo ( output . exportsInfo , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeExportTasksResponse = ( output , context ) : DescribeExportTasksResponse => { return { exportsInfo : output . exportsInfo !== undefined && output . exportsInfo !== null ? deserializeAws_json1_1ExportsInfo ( output . exportsInfo , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeImportTasksResponse = ( output , context ) : DescribeImportTasksResponse => { return { nextToken : __expectString ( output . nextToken ) , tasks : output . tasks !== undefined && output . tasks !== null ? deserializeAws_json1_1ImportTaskList ( output . tasks , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeTagsResponse = ( output , context ) : DescribeTagsResponse => { return { nextToken : __expectString ( output . nextToken ) , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_json1_1ConfigurationTagSet ( output . tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DisassociateConfigurationItemsFromApplicationResponse = ( output , context ) : DisassociateConfigurationItemsFromApplicationResponse => { return { } as any ; } ; const deserializeAws_json1_1ExportConfigurationsResponse = ( output , context ) : ExportConfigurationsResponse => { return { exportId : __expectString ( output . exportId ) , } as any ; } ; const deserializeAws_json1_1ExportInfo = ( output , context ) : ExportInfo => { return { configurationsDownloadUrl : __expectString ( output . configurationsDownloadUrl ) , exportId : __expectString ( output . exportId ) , exportRequestTime : output . exportRequestTime !== undefined && output . exportRequestTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . exportRequestTime ) ) ) : undefined , exportStatus : __expectString ( output . exportStatus ) , isTruncated : __expectBoolean ( output . isTruncated ) , requestedEndTime : output . requestedEndTime !== undefined && output . requestedEndTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . requestedEndTime ) ) ) : undefined , requestedStartTime : output . requestedStartTime !== undefined && output . requestedStartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . requestedStartTime ) ) ) : undefined , statusMessage : __expectString ( output . statusMessage ) , } as any ; } ; const deserializeAws_json1_1ExportsInfo = ( output , context ) : ExportInfo [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ExportInfo ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GetDiscoverySummaryResponse = ( output , context ) : GetDiscoverySummaryResponse => { return { agentSummary : output . agentSummary !== undefined && output . agentSummary !== null ? deserializeAws_json1_1CustomerAgentInfo ( output . agentSummary , context ) : undefined , applications : __expectLong ( output . applications ) , connectorSummary : output . connectorSummary !== undefined && output . connectorSummary !== null ? deserializeAws_json1_1CustomerConnectorInfo ( output . connectorSummary , context ) : undefined , servers : __expectLong ( output . servers ) , serversMappedToApplications : __expectLong ( output . serversMappedToApplications ) , serversMappedtoTags : __expectLong ( output . serversMappedtoTags ) , } as any ; } ; const deserializeAws_json1_1HomeRegionNotSetException = ( output , context ) : HomeRegionNotSetException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ImportTask = ( output , context ) : ImportTask => { return { applicationImportFailure : __expectInt32 ( output . applicationImportFailure ) , applicationImportSuccess : __expectInt32 ( output . applicationImportSuccess ) , clientRequestToken : __expectString ( output . clientRequestToken ) , errorsAndFailedEntriesZip : __expectString ( output . errorsAndFailedEntriesZip ) , importCompletionTime : output . importCompletionTime !== undefined && output . importCompletionTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . importCompletionTime ) ) ) : undefined , importDeletedTime : output . importDeletedTime !== undefined && output . importDeletedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . importDeletedTime ) ) ) : undefined , importRequestTime : output . importRequestTime !== undefined && output . importRequestTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . importRequestTime ) ) ) : undefined , importTaskId : __expectString ( output . importTaskId ) , importUrl : __expectString ( output . importUrl ) , name : __expectString ( output . name ) , serverImportFailure : __expectInt32 ( output . serverImportFailure ) , serverImportSuccess : __expectInt32 ( output . serverImportSuccess ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1ImportTaskList = ( output , context ) : ImportTask [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImportTask ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1InvalidParameterException = ( output , context ) : InvalidParameterException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidParameterValueException = ( output , context ) : InvalidParameterValueException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ListConfigurationsResponse = ( output , context ) : ListConfigurationsResponse => { return { configurations : output . configurations !== undefined && output . configurations !== null ? deserializeAws_json1_1Configurations ( output . configurations , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1ListServerNeighborsResponse = ( output , context ) : ListServerNeighborsResponse => { return { knownDependencyCount : __expectLong ( output . knownDependencyCount ) , neighbors : output . neighbors !== undefined && output . neighbors !== null ? deserializeAws_json1_1NeighborDetailsList ( output . neighbors , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1NeighborConnectionDetail = ( output , context ) : NeighborConnectionDetail => { return { connectionsCount : __expectLong ( output . connectionsCount ) , destinationPort : __expectInt32 ( output . destinationPort ) , destinationServerId : __expectString ( output . destinationServerId ) , sourceServerId : __expectString ( output . sourceServerId ) , transportProtocol : __expectString ( output . transportProtocol ) , } as any ; } ; const deserializeAws_json1_1NeighborDetailsList = ( output , context ) : NeighborConnectionDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1NeighborConnectionDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1OperationNotPermittedException = ( output , context ) : OperationNotPermittedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceInUseException = ( output , context ) : ResourceInUseException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1SchemaStorageConfig = ( 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_1ServerInternalErrorException = ( output , context ) : ServerInternalErrorException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1StartContinuousExportResponse = ( output , context ) : StartContinuousExportResponse => { return { dataSource : __expectString ( output . dataSource ) , exportId : __expectString ( output . exportId ) , s3Bucket : __expectString ( output . s3Bucket ) , schemaStorageConfig : output . schemaStorageConfig !== undefined && output . schemaStorageConfig !== null ? deserializeAws_json1_1SchemaStorageConfig ( output . schemaStorageConfig , context ) : undefined , startTime : output . startTime !== undefined && output . startTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1StartDataCollectionByAgentIdsResponse = ( output , context ) : StartDataCollectionByAgentIdsResponse => { return { agentsConfigurationStatus : output . agentsConfigurationStatus !== undefined && output . agentsConfigurationStatus !== null ? deserializeAws_json1_1AgentConfigurationStatusList ( output . agentsConfigurationStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StartExportTaskResponse = ( output , context ) : StartExportTaskResponse => { return { exportId : __expectString ( output . exportId ) , } as any ; } ; const deserializeAws_json1_1StartImportTaskResponse = ( output , context ) : StartImportTaskResponse => { return { task : output . task !== undefined && output . task !== null ? deserializeAws_json1_1ImportTask ( output . task , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StopContinuousExportResponse = ( output , context ) : StopContinuousExportResponse => { return { startTime : output . startTime !== undefined && output . startTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startTime ) ) ) : undefined , stopTime : output . stopTime !== undefined && output . stopTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . stopTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1StopDataCollectionByAgentIdsResponse = ( output , context ) : StopDataCollectionByAgentIdsResponse => { return { agentsConfigurationStatus : output . agentsConfigurationStatus !== undefined && output . agentsConfigurationStatus !== null ? deserializeAws_json1_1AgentConfigurationStatusList ( output . agentsConfigurationStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UpdateApplicationResponse = ( output , context ) : UpdateApplicationResponse => { return { } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;