import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectString as __expectString , limitedParseDouble as __limitedParseDouble , serializeFloat as __serializeFloat , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { CreateAnomalyMonitorCommandInput , CreateAnomalyMonitorCommandOutput , } from "../commands/CreateAnomalyMonitorCommand" ; import { CreateAnomalySubscriptionCommandInput , CreateAnomalySubscriptionCommandOutput , } from "../commands/CreateAnomalySubscriptionCommand" ; import { CreateCostCategoryDefinitionCommandInput , CreateCostCategoryDefinitionCommandOutput , } from "../commands/CreateCostCategoryDefinitionCommand" ; import { DeleteAnomalyMonitorCommandInput , DeleteAnomalyMonitorCommandOutput , } from "../commands/DeleteAnomalyMonitorCommand" ; import { DeleteAnomalySubscriptionCommandInput , DeleteAnomalySubscriptionCommandOutput , } from "../commands/DeleteAnomalySubscriptionCommand" ; import { DeleteCostCategoryDefinitionCommandInput , DeleteCostCategoryDefinitionCommandOutput , } from "../commands/DeleteCostCategoryDefinitionCommand" ; import { DescribeCostCategoryDefinitionCommandInput , DescribeCostCategoryDefinitionCommandOutput , } from "../commands/DescribeCostCategoryDefinitionCommand" ; import { GetAnomaliesCommandInput , GetAnomaliesCommandOutput } from "../commands/GetAnomaliesCommand" ; import { GetAnomalyMonitorsCommandInput , GetAnomalyMonitorsCommandOutput } from "../commands/GetAnomalyMonitorsCommand" ; import { GetAnomalySubscriptionsCommandInput , GetAnomalySubscriptionsCommandOutput , } from "../commands/GetAnomalySubscriptionsCommand" ; import { GetCostAndUsageCommandInput , GetCostAndUsageCommandOutput } from "../commands/GetCostAndUsageCommand" ; import { GetCostAndUsageWithResourcesCommandInput , GetCostAndUsageWithResourcesCommandOutput , } from "../commands/GetCostAndUsageWithResourcesCommand" ; import { GetCostCategoriesCommandInput , GetCostCategoriesCommandOutput } from "../commands/GetCostCategoriesCommand" ; import { GetCostForecastCommandInput , GetCostForecastCommandOutput } from "../commands/GetCostForecastCommand" ; import { GetDimensionValuesCommandInput , GetDimensionValuesCommandOutput } from "../commands/GetDimensionValuesCommand" ; import { GetReservationCoverageCommandInput , GetReservationCoverageCommandOutput , } from "../commands/GetReservationCoverageCommand" ; import { GetReservationPurchaseRecommendationCommandInput , GetReservationPurchaseRecommendationCommandOutput , } from "../commands/GetReservationPurchaseRecommendationCommand" ; import { GetReservationUtilizationCommandInput , GetReservationUtilizationCommandOutput , } from "../commands/GetReservationUtilizationCommand" ; import { GetRightsizingRecommendationCommandInput , GetRightsizingRecommendationCommandOutput , } from "../commands/GetRightsizingRecommendationCommand" ; import { GetSavingsPlansCoverageCommandInput , GetSavingsPlansCoverageCommandOutput , } from "../commands/GetSavingsPlansCoverageCommand" ; import { GetSavingsPlansPurchaseRecommendationCommandInput , GetSavingsPlansPurchaseRecommendationCommandOutput , } from "../commands/GetSavingsPlansPurchaseRecommendationCommand" ; import { GetSavingsPlansUtilizationCommandInput , GetSavingsPlansUtilizationCommandOutput , } from "../commands/GetSavingsPlansUtilizationCommand" ; import { GetSavingsPlansUtilizationDetailsCommandInput , GetSavingsPlansUtilizationDetailsCommandOutput , } from "../commands/GetSavingsPlansUtilizationDetailsCommand" ; import { GetTagsCommandInput , GetTagsCommandOutput } from "../commands/GetTagsCommand" ; import { GetUsageForecastCommandInput , GetUsageForecastCommandOutput } from "../commands/GetUsageForecastCommand" ; import { ListCostCategoryDefinitionsCommandInput , ListCostCategoryDefinitionsCommandOutput , } from "../commands/ListCostCategoryDefinitionsCommand" ; import { ProvideAnomalyFeedbackCommandInput , ProvideAnomalyFeedbackCommandOutput , } from "../commands/ProvideAnomalyFeedbackCommand" ; import { UpdateAnomalyMonitorCommandInput , UpdateAnomalyMonitorCommandOutput , } from "../commands/UpdateAnomalyMonitorCommand" ; import { UpdateAnomalySubscriptionCommandInput , UpdateAnomalySubscriptionCommandOutput , } from "../commands/UpdateAnomalySubscriptionCommand" ; import { UpdateCostCategoryDefinitionCommandInput , UpdateCostCategoryDefinitionCommandOutput , } from "../commands/UpdateCostCategoryDefinitionCommand" ; import { Anomaly , AnomalyDateInterval , AnomalyMonitor , AnomalyScore , AnomalySubscription , BillExpirationException , CostCategory , CostCategoryInheritedValueDimension , CostCategoryProcessingStatus , CostCategoryReference , CostCategoryRule , CostCategorySplitChargeRule , CostCategorySplitChargeRuleParameter , CostCategoryValues , Coverage , CoverageByTime , CoverageCost , CoverageHours , CoverageNormalizedUnits , CreateAnomalyMonitorRequest , CreateAnomalyMonitorResponse , CreateAnomalySubscriptionRequest , CreateAnomalySubscriptionResponse , CreateCostCategoryDefinitionRequest , CreateCostCategoryDefinitionResponse , CurrentInstance , DataUnavailableException , DateInterval , DeleteAnomalyMonitorRequest , DeleteAnomalyMonitorResponse , DeleteAnomalySubscriptionRequest , DeleteAnomalySubscriptionResponse , DeleteCostCategoryDefinitionRequest , DeleteCostCategoryDefinitionResponse , DescribeCostCategoryDefinitionRequest , DescribeCostCategoryDefinitionResponse , DimensionValues , DimensionValuesWithAttributes , DiskResourceUtilization , EBSResourceUtilization , EC2InstanceDetails , EC2ResourceDetails , EC2ResourceUtilization , EC2Specification , ElastiCacheInstanceDetails , ESInstanceDetails , Expression , FindingReasonCode , ForecastResult , GetAnomaliesRequest , GetAnomaliesResponse , GetAnomalyMonitorsRequest , GetAnomalyMonitorsResponse , GetAnomalySubscriptionsRequest , GetAnomalySubscriptionsResponse , GetCostAndUsageRequest , GetCostAndUsageResponse , GetCostAndUsageWithResourcesRequest , GetCostAndUsageWithResourcesResponse , GetCostCategoriesRequest , GetCostCategoriesResponse , GetCostForecastRequest , GetCostForecastResponse , GetDimensionValuesRequest , GetDimensionValuesResponse , GetReservationCoverageRequest , GetReservationCoverageResponse , GetReservationPurchaseRecommendationRequest , GetReservationPurchaseRecommendationResponse , GetReservationUtilizationRequest , GetReservationUtilizationResponse , GetRightsizingRecommendationRequest , GetRightsizingRecommendationResponse , GetSavingsPlansCoverageRequest , GetSavingsPlansCoverageResponse , GetSavingsPlansPurchaseRecommendationRequest , GetSavingsPlansPurchaseRecommendationResponse , GetSavingsPlansUtilizationDetailsRequest , GetSavingsPlansUtilizationDetailsResponse , GetSavingsPlansUtilizationRequest , GetSavingsPlansUtilizationResponse , GetTagsRequest , GetTagsResponse , GetUsageForecastRequest , GetUsageForecastResponse , Group , GroupDefinition , Impact , InstanceDetails , InvalidNextTokenException , LimitExceededException , ListCostCategoryDefinitionsRequest , ListCostCategoryDefinitionsResponse , MatchOption , MetricValue , ModifyRecommendationDetail , NetworkResourceUtilization , PlatformDifference , ProvideAnomalyFeedbackRequest , ProvideAnomalyFeedbackResponse , RDSInstanceDetails , RedshiftInstanceDetails , RequestChangedException , ReservationAggregates , ReservationCoverageGroup , ReservationPurchaseRecommendation , ReservationPurchaseRecommendationDetail , ReservationPurchaseRecommendationMetadata , ReservationPurchaseRecommendationSummary , ReservationUtilizationGroup , ResourceDetails , ResourceNotFoundException , ResourceUtilization , ResultByTime , RightsizingRecommendation , RightsizingRecommendationConfiguration , RightsizingRecommendationMetadata , RightsizingRecommendationSummary , RootCause , SavingsPlansAmortizedCommitment , SavingsPlansCoverage , SavingsPlansCoverageData , SavingsPlansDataType , SavingsPlansDetails , SavingsPlansPurchaseRecommendation , SavingsPlansPurchaseRecommendationDetail , SavingsPlansPurchaseRecommendationMetadata , SavingsPlansPurchaseRecommendationSummary , SavingsPlansSavings , SavingsPlansUtilization , SavingsPlansUtilizationAggregates , SavingsPlansUtilizationByTime , SavingsPlansUtilizationDetail , ServiceQuotaExceededException , ServiceSpecification , SortDefinition , Subscriber , TagValues , TargetInstance , TerminateRecommendationDetail , TotalImpactFilter , UnknownMonitorException , UnknownSubscriptionException , UnresolvableUsageUnitException , UpdateAnomalyMonitorRequest , UpdateAnomalyMonitorResponse , UpdateAnomalySubscriptionRequest , UpdateAnomalySubscriptionResponse , UpdateCostCategoryDefinitionRequest , UpdateCostCategoryDefinitionResponse , UtilizationByTime , } from "../models/models_0" ; export const serializeAws_json1_1CreateAnomalyMonitorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.CreateAnomalyMonitor" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateAnomalyMonitorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateAnomalySubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.CreateAnomalySubscription" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateAnomalySubscriptionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateCostCategoryDefinitionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.CreateCostCategoryDefinition" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateCostCategoryDefinitionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteAnomalyMonitorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.DeleteAnomalyMonitor" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteAnomalyMonitorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteAnomalySubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.DeleteAnomalySubscription" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteAnomalySubscriptionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteCostCategoryDefinitionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.DeleteCostCategoryDefinition" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteCostCategoryDefinitionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeCostCategoryDefinitionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.DescribeCostCategoryDefinition" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeCostCategoryDefinitionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetAnomaliesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetAnomalies" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetAnomaliesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetAnomalyMonitorsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetAnomalyMonitors" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetAnomalyMonitorsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetAnomalySubscriptionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetAnomalySubscriptions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetAnomalySubscriptionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetCostAndUsageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetCostAndUsage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetCostAndUsageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetCostAndUsageWithResourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetCostAndUsageWithResources" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetCostAndUsageWithResourcesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetCostCategoriesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetCostCategories" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetCostCategoriesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetCostForecastCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetCostForecast" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetCostForecastRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDimensionValuesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetDimensionValues" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDimensionValuesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetReservationCoverageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetReservationCoverage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetReservationCoverageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetReservationPurchaseRecommendationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetReservationPurchaseRecommendation" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetReservationPurchaseRecommendationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetReservationUtilizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetReservationUtilization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetReservationUtilizationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetRightsizingRecommendationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetRightsizingRecommendation" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetRightsizingRecommendationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetSavingsPlansCoverageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetSavingsPlansCoverage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetSavingsPlansCoverageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetSavingsPlansPurchaseRecommendation" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetSavingsPlansPurchaseRecommendationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetSavingsPlansUtilizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetSavingsPlansUtilization" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetSavingsPlansUtilizationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetSavingsPlansUtilizationDetailsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetSavingsPlansUtilizationDetails" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetSavingsPlansUtilizationDetailsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetUsageForecastCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.GetUsageForecast" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetUsageForecastRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListCostCategoryDefinitionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.ListCostCategoryDefinitions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListCostCategoryDefinitionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ProvideAnomalyFeedbackCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.ProvideAnomalyFeedback" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ProvideAnomalyFeedbackRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateAnomalyMonitorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.UpdateAnomalyMonitor" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateAnomalyMonitorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateAnomalySubscriptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.UpdateAnomalySubscription" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateAnomalySubscriptionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateCostCategoryDefinitionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSInsightsIndexService.UpdateCostCategoryDefinition" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateCostCategoryDefinitionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1CreateAnomalyMonitorCommand = async ( output , context ) : Promise < CreateAnomalyMonitorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateAnomalyMonitorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateAnomalyMonitorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateAnomalyMonitorCommandError = async ( output , context ) : Promise < CreateAnomalyMonitorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1CreateAnomalySubscriptionCommand = async ( output , context ) : Promise < CreateAnomalySubscriptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateAnomalySubscriptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateAnomalySubscriptionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateAnomalySubscriptionCommandError = async ( output , context ) : Promise < CreateAnomalySubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownMonitorException" : case "com.amazonaws.costexplorer#UnknownMonitorException" : response = { ... ( await deserializeAws_json1_1UnknownMonitorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1CreateCostCategoryDefinitionCommand = async ( output , context ) : Promise < CreateCostCategoryDefinitionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateCostCategoryDefinitionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateCostCategoryDefinitionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateCostCategoryDefinitionCommandError = async ( output , context ) : Promise < CreateCostCategoryDefinitionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.costexplorer#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteAnomalyMonitorCommand = async ( output , context ) : Promise < DeleteAnomalyMonitorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteAnomalyMonitorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteAnomalyMonitorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteAnomalyMonitorCommandError = async ( output , context ) : Promise < DeleteAnomalyMonitorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownMonitorException" : case "com.amazonaws.costexplorer#UnknownMonitorException" : response = { ... ( await deserializeAws_json1_1UnknownMonitorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteAnomalySubscriptionCommand = async ( output , context ) : Promise < DeleteAnomalySubscriptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteAnomalySubscriptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteAnomalySubscriptionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteAnomalySubscriptionCommandError = async ( output , context ) : Promise < DeleteAnomalySubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownSubscriptionException" : case "com.amazonaws.costexplorer#UnknownSubscriptionException" : response = { ... ( await deserializeAws_json1_1UnknownSubscriptionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteCostCategoryDefinitionCommand = async ( output , context ) : Promise < DeleteCostCategoryDefinitionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteCostCategoryDefinitionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteCostCategoryDefinitionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteCostCategoryDefinitionCommandError = async ( output , context ) : Promise < DeleteCostCategoryDefinitionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.costexplorer#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DescribeCostCategoryDefinitionCommand = async ( output , context ) : Promise < DescribeCostCategoryDefinitionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeCostCategoryDefinitionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeCostCategoryDefinitionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeCostCategoryDefinitionCommandError = async ( output , context ) : Promise < DescribeCostCategoryDefinitionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.costexplorer#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetAnomaliesCommand = async ( output , context ) : Promise < GetAnomaliesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetAnomaliesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetAnomaliesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetAnomaliesCommandError = async ( output , context ) : Promise < GetAnomaliesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetAnomalyMonitorsCommand = async ( output , context ) : Promise < GetAnomalyMonitorsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetAnomalyMonitorsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetAnomalyMonitorsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetAnomalyMonitorsCommandError = async ( output , context ) : Promise < GetAnomalyMonitorsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownMonitorException" : case "com.amazonaws.costexplorer#UnknownMonitorException" : response = { ... ( await deserializeAws_json1_1UnknownMonitorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetAnomalySubscriptionsCommand = async ( output , context ) : Promise < GetAnomalySubscriptionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetAnomalySubscriptionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetAnomalySubscriptionsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetAnomalySubscriptionsCommandError = async ( output , context ) : Promise < GetAnomalySubscriptionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownSubscriptionException" : case "com.amazonaws.costexplorer#UnknownSubscriptionException" : response = { ... ( await deserializeAws_json1_1UnknownSubscriptionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetCostAndUsageCommand = async ( output , context ) : Promise < GetCostAndUsageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetCostAndUsageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetCostAndUsageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetCostAndUsageCommandError = async ( output , context ) : Promise < GetCostAndUsageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "BillExpirationException" : case "com.amazonaws.costexplorer#BillExpirationException" : response = { ... ( await deserializeAws_json1_1BillExpirationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RequestChangedException" : case "com.amazonaws.costexplorer#RequestChangedException" : response = { ... ( await deserializeAws_json1_1RequestChangedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetCostAndUsageWithResourcesCommand = async ( output , context ) : Promise < GetCostAndUsageWithResourcesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetCostAndUsageWithResourcesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetCostAndUsageWithResourcesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetCostAndUsageWithResourcesCommandError = async ( output , context ) : Promise < GetCostAndUsageWithResourcesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "BillExpirationException" : case "com.amazonaws.costexplorer#BillExpirationException" : response = { ... ( await deserializeAws_json1_1BillExpirationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RequestChangedException" : case "com.amazonaws.costexplorer#RequestChangedException" : response = { ... ( await deserializeAws_json1_1RequestChangedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetCostCategoriesCommand = async ( output , context ) : Promise < GetCostCategoriesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetCostCategoriesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetCostCategoriesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetCostCategoriesCommandError = async ( output , context ) : Promise < GetCostCategoriesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "BillExpirationException" : case "com.amazonaws.costexplorer#BillExpirationException" : response = { ... ( await deserializeAws_json1_1BillExpirationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RequestChangedException" : case "com.amazonaws.costexplorer#RequestChangedException" : response = { ... ( await deserializeAws_json1_1RequestChangedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetCostForecastCommand = async ( output , context ) : Promise < GetCostForecastCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetCostForecastCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetCostForecastResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetCostForecastCommandError = async ( output , context ) : Promise < GetCostForecastCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetDimensionValuesCommand = async ( output , context ) : Promise < GetDimensionValuesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDimensionValuesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDimensionValuesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDimensionValuesCommandError = async ( output , context ) : Promise < GetDimensionValuesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "BillExpirationException" : case "com.amazonaws.costexplorer#BillExpirationException" : response = { ... ( await deserializeAws_json1_1BillExpirationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RequestChangedException" : case "com.amazonaws.costexplorer#RequestChangedException" : response = { ... ( await deserializeAws_json1_1RequestChangedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetReservationCoverageCommand = async ( output , context ) : Promise < GetReservationCoverageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetReservationCoverageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetReservationCoverageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetReservationCoverageCommandError = async ( output , context ) : Promise < GetReservationCoverageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetReservationPurchaseRecommendationCommand = async ( output , context ) : Promise < GetReservationPurchaseRecommendationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetReservationPurchaseRecommendationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetReservationPurchaseRecommendationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetReservationPurchaseRecommendationCommandError = async ( output , context ) : Promise < GetReservationPurchaseRecommendationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetReservationUtilizationCommand = async ( output , context ) : Promise < GetReservationUtilizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetReservationUtilizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetReservationUtilizationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetReservationUtilizationCommandError = async ( output , context ) : Promise < GetReservationUtilizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetRightsizingRecommendationCommand = async ( output , context ) : Promise < GetRightsizingRecommendationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetRightsizingRecommendationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetRightsizingRecommendationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetRightsizingRecommendationCommandError = async ( output , context ) : Promise < GetRightsizingRecommendationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetSavingsPlansCoverageCommand = async ( output , context ) : Promise < GetSavingsPlansCoverageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetSavingsPlansCoverageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetSavingsPlansCoverageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetSavingsPlansCoverageCommandError = async ( output , context ) : Promise < GetSavingsPlansCoverageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetSavingsPlansPurchaseRecommendationCommand = async ( output , context ) : Promise < GetSavingsPlansPurchaseRecommendationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationCommandError = async ( output , context ) : Promise < GetSavingsPlansPurchaseRecommendationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetSavingsPlansUtilizationCommand = async ( output , context ) : Promise < GetSavingsPlansUtilizationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetSavingsPlansUtilizationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetSavingsPlansUtilizationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetSavingsPlansUtilizationCommandError = async ( output , context ) : Promise < GetSavingsPlansUtilizationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetSavingsPlansUtilizationDetailsCommand = async ( output , context ) : Promise < GetSavingsPlansUtilizationDetailsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetSavingsPlansUtilizationDetailsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetSavingsPlansUtilizationDetailsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetSavingsPlansUtilizationDetailsCommandError = async ( output , context ) : Promise < GetSavingsPlansUtilizationDetailsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetTagsCommand = async ( output , context ) : Promise < GetTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetTagsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetTagsCommandError = async ( output , context ) : Promise < GetTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "BillExpirationException" : case "com.amazonaws.costexplorer#BillExpirationException" : response = { ... ( await deserializeAws_json1_1BillExpirationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.costexplorer#InvalidNextTokenException" : response = { ... ( await deserializeAws_json1_1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RequestChangedException" : case "com.amazonaws.costexplorer#RequestChangedException" : response = { ... ( await deserializeAws_json1_1RequestChangedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetUsageForecastCommand = async ( output , context ) : Promise < GetUsageForecastCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetUsageForecastCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetUsageForecastResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetUsageForecastCommandError = async ( output , context ) : Promise < GetUsageForecastCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "DataUnavailableException" : case "com.amazonaws.costexplorer#DataUnavailableException" : response = { ... ( await deserializeAws_json1_1DataUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnresolvableUsageUnitException" : case "com.amazonaws.costexplorer#UnresolvableUsageUnitException" : response = { ... ( await deserializeAws_json1_1UnresolvableUsageUnitExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListCostCategoryDefinitionsCommand = async ( output , context ) : Promise < ListCostCategoryDefinitionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListCostCategoryDefinitionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListCostCategoryDefinitionsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListCostCategoryDefinitionsCommandError = async ( output , context ) : Promise < ListCostCategoryDefinitionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ProvideAnomalyFeedbackCommand = async ( output , context ) : Promise < ProvideAnomalyFeedbackCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ProvideAnomalyFeedbackCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ProvideAnomalyFeedbackResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ProvideAnomalyFeedbackCommandError = async ( output , context ) : Promise < ProvideAnomalyFeedbackCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateAnomalyMonitorCommand = async ( output , context ) : Promise < UpdateAnomalyMonitorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateAnomalyMonitorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateAnomalyMonitorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateAnomalyMonitorCommandError = async ( output , context ) : Promise < UpdateAnomalyMonitorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownMonitorException" : case "com.amazonaws.costexplorer#UnknownMonitorException" : response = { ... ( await deserializeAws_json1_1UnknownMonitorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateAnomalySubscriptionCommand = async ( output , context ) : Promise < UpdateAnomalySubscriptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateAnomalySubscriptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateAnomalySubscriptionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateAnomalySubscriptionCommandError = async ( output , context ) : Promise < UpdateAnomalySubscriptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownMonitorException" : case "com.amazonaws.costexplorer#UnknownMonitorException" : response = { ... ( await deserializeAws_json1_1UnknownMonitorExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnknownSubscriptionException" : case "com.amazonaws.costexplorer#UnknownSubscriptionException" : response = { ... ( await deserializeAws_json1_1UnknownSubscriptionExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateCostCategoryDefinitionCommand = async ( output , context ) : Promise < UpdateCostCategoryDefinitionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateCostCategoryDefinitionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateCostCategoryDefinitionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateCostCategoryDefinitionCommandError = async ( output , context ) : Promise < UpdateCostCategoryDefinitionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "LimitExceededException" : case "com.amazonaws.costexplorer#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.costexplorer#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.costexplorer#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_1ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } 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_1BillExpirationExceptionResponse = async ( parsedOutput , context ) : Promise < BillExpirationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1BillExpirationException ( body , context ) ; const contents = { name : "BillExpirationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1DataUnavailableExceptionResponse = async ( parsedOutput , context ) : Promise < DataUnavailableException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1DataUnavailableException ( body , context ) ; const contents = { name : "DataUnavailableException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidNextTokenExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidNextTokenException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidNextTokenException ( body , context ) ; const contents = { name : "InvalidNextTokenException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LimitExceededException ( body , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RequestChangedExceptionResponse = async ( parsedOutput , context ) : Promise < RequestChangedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RequestChangedException ( body , context ) ; const contents = { name : "RequestChangedException" , $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_1ServiceQuotaExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceQuotaExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ServiceQuotaExceededException ( body , context ) ; const contents = { name : "ServiceQuotaExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnknownMonitorExceptionResponse = async ( parsedOutput , context ) : Promise < UnknownMonitorException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnknownMonitorException ( body , context ) ; const contents = { name : "UnknownMonitorException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnknownSubscriptionExceptionResponse = async ( parsedOutput , context ) : Promise < UnknownSubscriptionException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnknownSubscriptionException ( body , context ) ; const contents = { name : "UnknownSubscriptionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnresolvableUsageUnitExceptionResponse = async ( parsedOutput , context ) : Promise < UnresolvableUsageUnitException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnresolvableUsageUnitException ( body , context ) ; const contents = { name : "UnresolvableUsageUnitException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AnomalyDateInterval = ( input , context ) : any => { return { ... ( input . EndDate !== undefined && input . EndDate !== null && { EndDate : input . EndDate } ) , ... ( input . StartDate !== undefined && input . StartDate !== null && { StartDate : input . StartDate } ) , } ; } ; const serializeAws_json1_1AnomalyMonitor = ( input , context ) : any => { return { ... ( input . CreationDate !== undefined && input . CreationDate !== null && { CreationDate : input . CreationDate } ) , ... ( input . DimensionalValueCount !== undefined && input . DimensionalValueCount !== null && { DimensionalValueCount : input . DimensionalValueCount } ) , ... ( input . LastEvaluatedDate !== undefined && input . LastEvaluatedDate !== null && { LastEvaluatedDate : input . LastEvaluatedDate } ) , ... ( input . LastUpdatedDate !== undefined && input . LastUpdatedDate !== null && { LastUpdatedDate : input . LastUpdatedDate } ) , ... ( input . MonitorArn !== undefined && input . MonitorArn !== null && { MonitorArn : input . MonitorArn } ) , ... ( input . MonitorDimension !== undefined && input . MonitorDimension !== null && { MonitorDimension : input . MonitorDimension } ) , ... ( input . MonitorName !== undefined && input . MonitorName !== null && { MonitorName : input . MonitorName } ) , ... ( input . MonitorSpecification !== undefined && input . MonitorSpecification !== null && { MonitorSpecification : serializeAws_json1_1Expression ( input . MonitorSpecification , context ) , } ) , ... ( input . MonitorType !== undefined && input . MonitorType !== null && { MonitorType : input . MonitorType } ) , } ; } ; const serializeAws_json1_1AnomalySubscription = ( input , context ) : any => { return { ... ( input . AccountId !== undefined && input . AccountId !== null && { AccountId : input . AccountId } ) , ... ( input . Frequency !== undefined && input . Frequency !== null && { Frequency : input . Frequency } ) , ... ( input . MonitorArnList !== undefined && input . MonitorArnList !== null && { MonitorArnList : serializeAws_json1_1MonitorArnList ( input . MonitorArnList , context ) , } ) , ... ( input . Subscribers !== undefined && input . Subscribers !== null && { Subscribers : serializeAws_json1_1Subscribers ( input . Subscribers , context ) } ) , ... ( input . SubscriptionArn !== undefined && input . SubscriptionArn !== null && { SubscriptionArn : input . SubscriptionArn } ) , ... ( input . SubscriptionName !== undefined && input . SubscriptionName !== null && { SubscriptionName : input . SubscriptionName } ) , ... ( input . Threshold !== undefined && input . Threshold !== null && { Threshold : __serializeFloat ( input . Threshold ) } ) , } ; } ; const serializeAws_json1_1CostCategoryInheritedValueDimension = ( input , context ) : any => { return { ... ( input . DimensionKey !== undefined && input . DimensionKey !== null && { DimensionKey : input . DimensionKey } ) , ... ( input . DimensionName !== undefined && input . DimensionName !== null && { DimensionName : input . DimensionName } ) , } ; } ; const serializeAws_json1_1CostCategoryRule = ( input , context ) : any => { return { ... ( input . InheritedValue !== undefined && input . InheritedValue !== null && { InheritedValue : serializeAws_json1_1CostCategoryInheritedValueDimension ( input . InheritedValue , context ) , } ) , ... ( input . Rule !== undefined && input . Rule !== null && { Rule : serializeAws_json1_1Expression ( input . Rule , context ) } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1CostCategoryRulesList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1CostCategoryRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_1CostCategorySplitChargeRule = ( input , context ) : any => { return { ... ( input . Method !== undefined && input . Method !== null && { Method : input . Method } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : serializeAws_json1_1CostCategorySplitChargeRuleParametersList ( input . Parameters , context ) , } ) , ... ( input . Source !== undefined && input . Source !== null && { Source : input . Source } ) , ... ( input . Targets !== undefined && input . Targets !== null && { Targets : serializeAws_json1_1CostCategorySplitChargeRuleTargetsList ( input . Targets , context ) , } ) , } ; } ; const serializeAws_json1_1CostCategorySplitChargeRuleParameter = ( input , context ) : any => { return { ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1CostCategorySplitChargeRuleParameterValuesList ( input . Values , context ) , } ) , } ; } ; const serializeAws_json1_1CostCategorySplitChargeRuleParametersList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1CostCategorySplitChargeRuleParameter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1CostCategorySplitChargeRuleParameterValuesList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1CostCategorySplitChargeRulesList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1CostCategorySplitChargeRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_1CostCategorySplitChargeRuleTargetsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1CostCategoryValues = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . MatchOptions !== undefined && input . MatchOptions !== null && { MatchOptions : serializeAws_json1_1MatchOptions ( input . MatchOptions , context ) } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1Values ( input . Values , context ) } ) , } ; } ; const serializeAws_json1_1CreateAnomalyMonitorRequest = ( input , context ) : any => { return { ... ( input . AnomalyMonitor !== undefined && input . AnomalyMonitor !== null && { AnomalyMonitor : serializeAws_json1_1AnomalyMonitor ( input . AnomalyMonitor , context ) , } ) , } ; } ; const serializeAws_json1_1CreateAnomalySubscriptionRequest = ( input , context ) : any => { return { ... ( input . AnomalySubscription !== undefined && input . AnomalySubscription !== null && { AnomalySubscription : serializeAws_json1_1AnomalySubscription ( input . AnomalySubscription , context ) , } ) , } ; } ; const serializeAws_json1_1CreateCostCategoryDefinitionRequest = ( input , context ) : any => { return { ... ( input . DefaultValue !== undefined && input . DefaultValue !== null && { DefaultValue : input . DefaultValue } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . RuleVersion !== undefined && input . RuleVersion !== null && { RuleVersion : input . RuleVersion } ) , ... ( input . Rules !== undefined && input . Rules !== null && { Rules : serializeAws_json1_1CostCategoryRulesList ( input . Rules , context ) } ) , ... ( input . SplitChargeRules !== undefined && input . SplitChargeRules !== null && { SplitChargeRules : serializeAws_json1_1CostCategorySplitChargeRulesList ( input . SplitChargeRules , context ) , } ) , } ; } ; const serializeAws_json1_1DateInterval = ( input , context ) : any => { return { ... ( input . End !== undefined && input . End !== null && { End : input . End } ) , ... ( input . Start !== undefined && input . Start !== null && { Start : input . Start } ) , } ; } ; const serializeAws_json1_1DeleteAnomalyMonitorRequest = ( input , context ) : any => { return { ... ( input . MonitorArn !== undefined && input . MonitorArn !== null && { MonitorArn : input . MonitorArn } ) , } ; } ; const serializeAws_json1_1DeleteAnomalySubscriptionRequest = ( input , context ) : any => { return { ... ( input . SubscriptionArn !== undefined && input . SubscriptionArn !== null && { SubscriptionArn : input . SubscriptionArn } ) , } ; } ; const serializeAws_json1_1DeleteCostCategoryDefinitionRequest = ( input , context ) : any => { return { ... ( input . CostCategoryArn !== undefined && input . CostCategoryArn !== null && { CostCategoryArn : input . CostCategoryArn } ) , } ; } ; const serializeAws_json1_1DescribeCostCategoryDefinitionRequest = ( input , context ) : any => { return { ... ( input . CostCategoryArn !== undefined && input . CostCategoryArn !== null && { CostCategoryArn : input . CostCategoryArn } ) , ... ( input . EffectiveOn !== undefined && input . EffectiveOn !== null && { EffectiveOn : input . EffectiveOn } ) , } ; } ; const serializeAws_json1_1DimensionValues = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . MatchOptions !== undefined && input . MatchOptions !== null && { MatchOptions : serializeAws_json1_1MatchOptions ( input . MatchOptions , context ) } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1Values ( input . Values , context ) } ) , } ; } ; const serializeAws_json1_1EC2Specification = ( input , context ) : any => { return { ... ( input . OfferingClass !== undefined && input . OfferingClass !== null && { OfferingClass : input . OfferingClass } ) , } ; } ; const serializeAws_json1_1Expression = ( input , context ) : any => { return { ... ( input . And !== undefined && input . And !== null && { And : serializeAws_json1_1Expressions ( input . And , context ) } ) , ... ( input . CostCategories !== undefined && input . CostCategories !== null && { CostCategories : serializeAws_json1_1CostCategoryValues ( input . CostCategories , context ) , } ) , ... ( input . Dimensions !== undefined && input . Dimensions !== null && { Dimensions : serializeAws_json1_1DimensionValues ( input . Dimensions , context ) } ) , ... ( input . Not !== undefined && input . Not !== null && { Not : serializeAws_json1_1Expression ( input . Not , context ) } ) , ... ( input . Or !== undefined && input . Or !== null && { Or : serializeAws_json1_1Expressions ( input . Or , context ) } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagValues ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1Expressions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Expression ( entry , context ) ; } ) ; } ; const serializeAws_json1_1GetAnomaliesRequest = ( input , context ) : any => { return { ... ( input . DateInterval !== undefined && input . DateInterval !== null && { DateInterval : serializeAws_json1_1AnomalyDateInterval ( input . DateInterval , context ) , } ) , ... ( input . Feedback !== undefined && input . Feedback !== null && { Feedback : input . Feedback } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . MonitorArn !== undefined && input . MonitorArn !== null && { MonitorArn : input . MonitorArn } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . TotalImpact !== undefined && input . TotalImpact !== null && { TotalImpact : serializeAws_json1_1TotalImpactFilter ( input . TotalImpact , context ) } ) , } ; } ; const serializeAws_json1_1GetAnomalyMonitorsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . MonitorArnList !== undefined && input . MonitorArnList !== null && { MonitorArnList : serializeAws_json1_1Values ( input . MonitorArnList , context ) } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , } ; } ; const serializeAws_json1_1GetAnomalySubscriptionsRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . MonitorArn !== undefined && input . MonitorArn !== null && { MonitorArn : input . MonitorArn } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SubscriptionArnList !== undefined && input . SubscriptionArnList !== null && { SubscriptionArnList : serializeAws_json1_1Values ( input . SubscriptionArnList , context ) , } ) , } ; } ; const serializeAws_json1_1GetCostAndUsageRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . GroupBy !== undefined && input . GroupBy !== null && { GroupBy : serializeAws_json1_1GroupDefinitions ( input . GroupBy , context ) } ) , ... ( input . Metrics !== undefined && input . Metrics !== null && { Metrics : serializeAws_json1_1MetricNames ( input . Metrics , context ) } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetCostAndUsageWithResourcesRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . GroupBy !== undefined && input . GroupBy !== null && { GroupBy : serializeAws_json1_1GroupDefinitions ( input . GroupBy , context ) } ) , ... ( input . Metrics !== undefined && input . Metrics !== null && { Metrics : serializeAws_json1_1MetricNames ( input . Metrics , context ) } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetCostCategoriesRequest = ( input , context ) : any => { return { ... ( input . CostCategoryName !== undefined && input . CostCategoryName !== null && { CostCategoryName : input . CostCategoryName } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SearchString !== undefined && input . SearchString !== null && { SearchString : input . SearchString } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinitions ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetCostForecastRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . Metric !== undefined && input . Metric !== null && { Metric : input . Metric } ) , ... ( input . PredictionIntervalLevel !== undefined && input . PredictionIntervalLevel !== null && { PredictionIntervalLevel : input . PredictionIntervalLevel } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetDimensionValuesRequest = ( input , context ) : any => { return { ... ( input . Context !== undefined && input . Context !== null && { Context : input . Context } ) , ... ( input . Dimension !== undefined && input . Dimension !== null && { Dimension : input . Dimension } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SearchString !== undefined && input . SearchString !== null && { SearchString : input . SearchString } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinitions ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetReservationCoverageRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . GroupBy !== undefined && input . GroupBy !== null && { GroupBy : serializeAws_json1_1GroupDefinitions ( input . GroupBy , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . Metrics !== undefined && input . Metrics !== null && { Metrics : serializeAws_json1_1MetricNames ( input . Metrics , context ) } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinition ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetReservationPurchaseRecommendationRequest = ( input , context ) : any => { return { ... ( input . AccountId !== undefined && input . AccountId !== null && { AccountId : input . AccountId } ) , ... ( input . AccountScope !== undefined && input . AccountScope !== null && { AccountScope : input . AccountScope } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . LookbackPeriodInDays !== undefined && input . LookbackPeriodInDays !== null && { LookbackPeriodInDays : input . LookbackPeriodInDays } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . PageSize !== undefined && input . PageSize !== null && { PageSize : input . PageSize } ) , ... ( input . PaymentOption !== undefined && input . PaymentOption !== null && { PaymentOption : input . PaymentOption } ) , ... ( input . Service !== undefined && input . Service !== null && { Service : input . Service } ) , ... ( input . ServiceSpecification !== undefined && input . ServiceSpecification !== null && { ServiceSpecification : serializeAws_json1_1ServiceSpecification ( input . ServiceSpecification , context ) , } ) , ... ( input . TermInYears !== undefined && input . TermInYears !== null && { TermInYears : input . TermInYears } ) , } ; } ; const serializeAws_json1_1GetReservationUtilizationRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . GroupBy !== undefined && input . GroupBy !== null && { GroupBy : serializeAws_json1_1GroupDefinitions ( input . GroupBy , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinition ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetRightsizingRecommendationRequest = ( input , context ) : any => { return { ... ( input . Configuration !== undefined && input . Configuration !== null && { Configuration : serializeAws_json1_1RightsizingRecommendationConfiguration ( input . Configuration , context ) , } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . PageSize !== undefined && input . PageSize !== null && { PageSize : input . PageSize } ) , ... ( input . Service !== undefined && input . Service !== null && { Service : input . Service } ) , } ; } ; const serializeAws_json1_1GetSavingsPlansCoverageRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . GroupBy !== undefined && input . GroupBy !== null && { GroupBy : serializeAws_json1_1GroupDefinitions ( input . GroupBy , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . Metrics !== undefined && input . Metrics !== null && { Metrics : serializeAws_json1_1MetricNames ( input . Metrics , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinition ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetSavingsPlansPurchaseRecommendationRequest = ( input , context ) : any => { return { ... ( input . AccountScope !== undefined && input . AccountScope !== null && { AccountScope : input . AccountScope } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . LookbackPeriodInDays !== undefined && input . LookbackPeriodInDays !== null && { LookbackPeriodInDays : input . LookbackPeriodInDays } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . PageSize !== undefined && input . PageSize !== null && { PageSize : input . PageSize } ) , ... ( input . PaymentOption !== undefined && input . PaymentOption !== null && { PaymentOption : input . PaymentOption } ) , ... ( input . SavingsPlansType !== undefined && input . SavingsPlansType !== null && { SavingsPlansType : input . SavingsPlansType } ) , ... ( input . TermInYears !== undefined && input . TermInYears !== null && { TermInYears : input . TermInYears } ) , } ; } ; const serializeAws_json1_1GetSavingsPlansUtilizationDetailsRequest = ( input , context ) : any => { return { ... ( input . DataType !== undefined && input . DataType !== null && { DataType : serializeAws_json1_1SavingsPlansDataTypes ( input . DataType , context ) } ) , ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinition ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetSavingsPlansUtilizationRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinition ( input . SortBy , context ) } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetTagsRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextPageToken !== undefined && input . NextPageToken !== null && { NextPageToken : input . NextPageToken } ) , ... ( input . SearchString !== undefined && input . SearchString !== null && { SearchString : input . SearchString } ) , ... ( input . SortBy !== undefined && input . SortBy !== null && { SortBy : serializeAws_json1_1SortDefinitions ( input . SortBy , context ) } ) , ... ( input . TagKey !== undefined && input . TagKey !== null && { TagKey : input . TagKey } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GetUsageForecastRequest = ( input , context ) : any => { return { ... ( input . Filter !== undefined && input . Filter !== null && { Filter : serializeAws_json1_1Expression ( input . Filter , context ) } ) , ... ( input . Granularity !== undefined && input . Granularity !== null && { Granularity : input . Granularity } ) , ... ( input . Metric !== undefined && input . Metric !== null && { Metric : input . Metric } ) , ... ( input . PredictionIntervalLevel !== undefined && input . PredictionIntervalLevel !== null && { PredictionIntervalLevel : input . PredictionIntervalLevel } ) , ... ( input . TimePeriod !== undefined && input . TimePeriod !== null && { TimePeriod : serializeAws_json1_1DateInterval ( input . TimePeriod , context ) } ) , } ; } ; const serializeAws_json1_1GroupDefinition = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_1GroupDefinitions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1GroupDefinition ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ListCostCategoryDefinitionsRequest = ( input , context ) : any => { return { ... ( input . EffectiveOn !== undefined && input . EffectiveOn !== null && { EffectiveOn : input . EffectiveOn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1MatchOptions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MetricNames = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1MonitorArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ProvideAnomalyFeedbackRequest = ( input , context ) : any => { return { ... ( input . AnomalyId !== undefined && input . AnomalyId !== null && { AnomalyId : input . AnomalyId } ) , ... ( input . Feedback !== undefined && input . Feedback !== null && { Feedback : input . Feedback } ) , } ; } ; const serializeAws_json1_1RightsizingRecommendationConfiguration = ( input , context ) : any => { return { ... ( input . BenefitsConsidered !== undefined && input . BenefitsConsidered !== null && { BenefitsConsidered : input . BenefitsConsidered } ) , ... ( input . RecommendationTarget !== undefined && input . RecommendationTarget !== null && { RecommendationTarget : input . RecommendationTarget } ) , } ; } ; const serializeAws_json1_1SavingsPlansDataTypes = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ServiceSpecification = ( input , context ) : any => { return { ... ( input . EC2Specification !== undefined && input . EC2Specification !== null && { EC2Specification : serializeAws_json1_1EC2Specification ( input . EC2Specification , context ) , } ) , } ; } ; const serializeAws_json1_1SortDefinition = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . SortOrder !== undefined && input . SortOrder !== null && { SortOrder : input . SortOrder } ) , } ; } ; const serializeAws_json1_1SortDefinitions = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1SortDefinition ( entry , context ) ; } ) ; } ; const serializeAws_json1_1Subscriber = ( input , context ) : any => { return { ... ( input . Address !== undefined && input . Address !== null && { Address : input . Address } ) , ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_json1_1Subscribers = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Subscriber ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TagValues = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . MatchOptions !== undefined && input . MatchOptions !== null && { MatchOptions : serializeAws_json1_1MatchOptions ( input . MatchOptions , context ) } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1Values ( input . Values , context ) } ) , } ; } ; const serializeAws_json1_1TotalImpactFilter = ( input , context ) : any => { return { ... ( input . EndValue !== undefined && input . EndValue !== null && { EndValue : __serializeFloat ( input . EndValue ) } ) , ... ( input . NumericOperator !== undefined && input . NumericOperator !== null && { NumericOperator : input . NumericOperator } ) , ... ( input . StartValue !== undefined && input . StartValue !== null && { StartValue : __serializeFloat ( input . StartValue ) } ) , } ; } ; const serializeAws_json1_1UpdateAnomalyMonitorRequest = ( input , context ) : any => { return { ... ( input . MonitorArn !== undefined && input . MonitorArn !== null && { MonitorArn : input . MonitorArn } ) , ... ( input . MonitorName !== undefined && input . MonitorName !== null && { MonitorName : input . MonitorName } ) , } ; } ; const serializeAws_json1_1UpdateAnomalySubscriptionRequest = ( input , context ) : any => { return { ... ( input . Frequency !== undefined && input . Frequency !== null && { Frequency : input . Frequency } ) , ... ( input . MonitorArnList !== undefined && input . MonitorArnList !== null && { MonitorArnList : serializeAws_json1_1MonitorArnList ( input . MonitorArnList , context ) , } ) , ... ( input . Subscribers !== undefined && input . Subscribers !== null && { Subscribers : serializeAws_json1_1Subscribers ( input . Subscribers , context ) } ) , ... ( input . SubscriptionArn !== undefined && input . SubscriptionArn !== null && { SubscriptionArn : input . SubscriptionArn } ) , ... ( input . SubscriptionName !== undefined && input . SubscriptionName !== null && { SubscriptionName : input . SubscriptionName } ) , ... ( input . Threshold !== undefined && input . Threshold !== null && { Threshold : __serializeFloat ( input . Threshold ) } ) , } ; } ; const serializeAws_json1_1UpdateCostCategoryDefinitionRequest = ( input , context ) : any => { return { ... ( input . CostCategoryArn !== undefined && input . CostCategoryArn !== null && { CostCategoryArn : input . CostCategoryArn } ) , ... ( input . DefaultValue !== undefined && input . DefaultValue !== null && { DefaultValue : input . DefaultValue } ) , ... ( input . RuleVersion !== undefined && input . RuleVersion !== null && { RuleVersion : input . RuleVersion } ) , ... ( input . Rules !== undefined && input . Rules !== null && { Rules : serializeAws_json1_1CostCategoryRulesList ( input . Rules , context ) } ) , ... ( input . SplitChargeRules !== undefined && input . SplitChargeRules !== null && { SplitChargeRules : serializeAws_json1_1CostCategorySplitChargeRulesList ( input . SplitChargeRules , context ) , } ) , } ; } ; const serializeAws_json1_1Values = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const deserializeAws_json1_1Anomalies = ( output , context ) : Anomaly [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Anomaly ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Anomaly = ( output , context ) : Anomaly => { return { AnomalyEndDate : __expectString ( output . AnomalyEndDate ) , AnomalyId : __expectString ( output . AnomalyId ) , AnomalyScore : output . AnomalyScore !== undefined && output . AnomalyScore !== null ? deserializeAws_json1_1AnomalyScore ( output . AnomalyScore , context ) : undefined , AnomalyStartDate : __expectString ( output . AnomalyStartDate ) , DimensionValue : __expectString ( output . DimensionValue ) , Feedback : __expectString ( output . Feedback ) , Impact : output . Impact !== undefined && output . Impact !== null ? deserializeAws_json1_1Impact ( output . Impact , context ) : undefined , MonitorArn : __expectString ( output . MonitorArn ) , RootCauses : output . RootCauses !== undefined && output . RootCauses !== null ? deserializeAws_json1_1RootCauses ( output . RootCauses , context ) : undefined , } as any ; } ; const deserializeAws_json1_1AnomalyMonitor = ( output , context ) : AnomalyMonitor => { return { CreationDate : __expectString ( output . CreationDate ) , DimensionalValueCount : __expectInt32 ( output . DimensionalValueCount ) , LastEvaluatedDate : __expectString ( output . LastEvaluatedDate ) , LastUpdatedDate : __expectString ( output . LastUpdatedDate ) , MonitorArn : __expectString ( output . MonitorArn ) , MonitorDimension : __expectString ( output . MonitorDimension ) , MonitorName : __expectString ( output . MonitorName ) , MonitorSpecification : output . MonitorSpecification !== undefined && output . MonitorSpecification !== null ? deserializeAws_json1_1Expression ( output . MonitorSpecification , context ) : undefined , MonitorType : __expectString ( output . MonitorType ) , } as any ; } ; const deserializeAws_json1_1AnomalyMonitors = ( output , context ) : AnomalyMonitor [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AnomalyMonitor ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AnomalyScore = ( output , context ) : AnomalyScore => { return { CurrentScore : __limitedParseDouble ( output . CurrentScore ) , MaxScore : __limitedParseDouble ( output . MaxScore ) , } as any ; } ; const deserializeAws_json1_1AnomalySubscription = ( output , context ) : AnomalySubscription => { return { AccountId : __expectString ( output . AccountId ) , Frequency : __expectString ( output . Frequency ) , MonitorArnList : output . MonitorArnList !== undefined && output . MonitorArnList !== null ? deserializeAws_json1_1MonitorArnList ( output . MonitorArnList , context ) : undefined , Subscribers : output . Subscribers !== undefined && output . Subscribers !== null ? deserializeAws_json1_1Subscribers ( output . Subscribers , context ) : undefined , SubscriptionArn : __expectString ( output . SubscriptionArn ) , SubscriptionName : __expectString ( output . SubscriptionName ) , Threshold : __limitedParseDouble ( output . Threshold ) , } as any ; } ; const deserializeAws_json1_1AnomalySubscriptions = ( output , context ) : AnomalySubscription [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AnomalySubscription ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Attributes = ( 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_1BillExpirationException = ( output , context ) : BillExpirationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1CostCategory = ( output , context ) : CostCategory => { return { CostCategoryArn : __expectString ( output . CostCategoryArn ) , DefaultValue : __expectString ( output . DefaultValue ) , EffectiveEnd : __expectString ( output . EffectiveEnd ) , EffectiveStart : __expectString ( output . EffectiveStart ) , Name : __expectString ( output . Name ) , ProcessingStatus : output . ProcessingStatus !== undefined && output . ProcessingStatus !== null ? deserializeAws_json1_1CostCategoryProcessingStatusList ( output . ProcessingStatus , context ) : undefined , RuleVersion : __expectString ( output . RuleVersion ) , Rules : output . Rules !== undefined && output . Rules !== null ? deserializeAws_json1_1CostCategoryRulesList ( output . Rules , context ) : undefined , SplitChargeRules : output . SplitChargeRules !== undefined && output . SplitChargeRules !== null ? deserializeAws_json1_1CostCategorySplitChargeRulesList ( output . SplitChargeRules , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CostCategoryInheritedValueDimension = ( output , context ) : CostCategoryInheritedValueDimension => { return { DimensionKey : __expectString ( output . DimensionKey ) , DimensionName : __expectString ( output . DimensionName ) , } as any ; } ; const deserializeAws_json1_1CostCategoryNamesList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1CostCategoryProcessingStatus = ( output , context ) : CostCategoryProcessingStatus => { return { Component : __expectString ( output . Component ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1CostCategoryProcessingStatusList = ( output , context ) : CostCategoryProcessingStatus [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CostCategoryProcessingStatus ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CostCategoryReference = ( output , context ) : CostCategoryReference => { return { CostCategoryArn : __expectString ( output . CostCategoryArn ) , DefaultValue : __expectString ( output . DefaultValue ) , EffectiveEnd : __expectString ( output . EffectiveEnd ) , EffectiveStart : __expectString ( output . EffectiveStart ) , Name : __expectString ( output . Name ) , NumberOfRules : __expectInt32 ( output . NumberOfRules ) , ProcessingStatus : output . ProcessingStatus !== undefined && output . ProcessingStatus !== null ? deserializeAws_json1_1CostCategoryProcessingStatusList ( output . ProcessingStatus , context ) : undefined , Values : output . Values !== undefined && output . Values !== null ? deserializeAws_json1_1CostCategoryValuesList ( output . Values , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CostCategoryReferencesList = ( output , context ) : CostCategoryReference [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CostCategoryReference ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CostCategoryRule = ( output , context ) : CostCategoryRule => { return { InheritedValue : output . InheritedValue !== undefined && output . InheritedValue !== null ? deserializeAws_json1_1CostCategoryInheritedValueDimension ( output . InheritedValue , context ) : undefined , Rule : output . Rule !== undefined && output . Rule !== null ? deserializeAws_json1_1Expression ( output . Rule , context ) : undefined , Type : __expectString ( output . Type ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1CostCategoryRulesList = ( output , context ) : CostCategoryRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CostCategoryRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CostCategorySplitChargeRule = ( output , context ) : CostCategorySplitChargeRule => { return { Method : __expectString ( output . Method ) , Parameters : output . Parameters !== undefined && output . Parameters !== null ? deserializeAws_json1_1CostCategorySplitChargeRuleParametersList ( output . Parameters , context ) : undefined , Source : __expectString ( output . Source ) , Targets : output . Targets !== undefined && output . Targets !== null ? deserializeAws_json1_1CostCategorySplitChargeRuleTargetsList ( output . Targets , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CostCategorySplitChargeRuleParameter = ( output , context ) : CostCategorySplitChargeRuleParameter => { return { Type : __expectString ( output . Type ) , Values : output . Values !== undefined && output . Values !== null ? deserializeAws_json1_1CostCategorySplitChargeRuleParameterValuesList ( output . Values , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CostCategorySplitChargeRuleParametersList = ( output , context ) : CostCategorySplitChargeRuleParameter [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CostCategorySplitChargeRuleParameter ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CostCategorySplitChargeRuleParameterValuesList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1CostCategorySplitChargeRulesList = ( output , context ) : CostCategorySplitChargeRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CostCategorySplitChargeRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CostCategorySplitChargeRuleTargetsList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1CostCategoryValues = ( output , context ) : CostCategoryValues => { return { Key : __expectString ( output . Key ) , MatchOptions : output . MatchOptions !== undefined && output . MatchOptions !== null ? deserializeAws_json1_1MatchOptions ( output . MatchOptions , context ) : undefined , Values : output . Values !== undefined && output . Values !== null ? deserializeAws_json1_1Values ( output . Values , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CostCategoryValuesList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1Coverage = ( output , context ) : Coverage => { return { CoverageCost : output . CoverageCost !== undefined && output . CoverageCost !== null ? deserializeAws_json1_1CoverageCost ( output . CoverageCost , context ) : undefined , CoverageHours : output . CoverageHours !== undefined && output . CoverageHours !== null ? deserializeAws_json1_1CoverageHours ( output . CoverageHours , context ) : undefined , CoverageNormalizedUnits : output . CoverageNormalizedUnits !== undefined && output . CoverageNormalizedUnits !== null ? deserializeAws_json1_1CoverageNormalizedUnits ( output . CoverageNormalizedUnits , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CoverageByTime = ( output , context ) : CoverageByTime => { return { Groups : output . Groups !== undefined && output . Groups !== null ? deserializeAws_json1_1ReservationCoverageGroups ( output . Groups , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1Coverage ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CoverageCost = ( output , context ) : CoverageCost => { return { OnDemandCost : __expectString ( output . OnDemandCost ) , } as any ; } ; const deserializeAws_json1_1CoverageHours = ( output , context ) : CoverageHours => { return { CoverageHoursPercentage : __expectString ( output . CoverageHoursPercentage ) , OnDemandHours : __expectString ( output . OnDemandHours ) , ReservedHours : __expectString ( output . ReservedHours ) , TotalRunningHours : __expectString ( output . TotalRunningHours ) , } as any ; } ; const deserializeAws_json1_1CoverageNormalizedUnits = ( output , context ) : CoverageNormalizedUnits => { return { CoverageNormalizedUnitsPercentage : __expectString ( output . CoverageNormalizedUnitsPercentage ) , OnDemandNormalizedUnits : __expectString ( output . OnDemandNormalizedUnits ) , ReservedNormalizedUnits : __expectString ( output . ReservedNormalizedUnits ) , TotalRunningNormalizedUnits : __expectString ( output . TotalRunningNormalizedUnits ) , } as any ; } ; const deserializeAws_json1_1CoveragesByTime = ( output , context ) : CoverageByTime [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CoverageByTime ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CreateAnomalyMonitorResponse = ( output , context ) : CreateAnomalyMonitorResponse => { return { MonitorArn : __expectString ( output . MonitorArn ) , } as any ; } ; const deserializeAws_json1_1CreateAnomalySubscriptionResponse = ( output , context ) : CreateAnomalySubscriptionResponse => { return { SubscriptionArn : __expectString ( output . SubscriptionArn ) , } as any ; } ; const deserializeAws_json1_1CreateCostCategoryDefinitionResponse = ( output , context ) : CreateCostCategoryDefinitionResponse => { return { CostCategoryArn : __expectString ( output . CostCategoryArn ) , EffectiveStart : __expectString ( output . EffectiveStart ) , } as any ; } ; const deserializeAws_json1_1CurrentInstance = ( output , context ) : CurrentInstance => { return { CurrencyCode : __expectString ( output . CurrencyCode ) , InstanceName : __expectString ( output . InstanceName ) , MonthlyCost : __expectString ( output . MonthlyCost ) , OnDemandHoursInLookbackPeriod : __expectString ( output . OnDemandHoursInLookbackPeriod ) , ReservationCoveredHoursInLookbackPeriod : __expectString ( output . ReservationCoveredHoursInLookbackPeriod ) , ResourceDetails : output . ResourceDetails !== undefined && output . ResourceDetails !== null ? deserializeAws_json1_1ResourceDetails ( output . ResourceDetails , context ) : undefined , ResourceId : __expectString ( output . ResourceId ) , ResourceUtilization : output . ResourceUtilization !== undefined && output . ResourceUtilization !== null ? deserializeAws_json1_1ResourceUtilization ( output . ResourceUtilization , context ) : undefined , SavingsPlansCoveredHoursInLookbackPeriod : __expectString ( output . SavingsPlansCoveredHoursInLookbackPeriod ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagValuesList ( output . Tags , context ) : undefined , TotalRunningHoursInLookbackPeriod : __expectString ( output . TotalRunningHoursInLookbackPeriod ) , } as any ; } ; const deserializeAws_json1_1DataUnavailableException = ( output , context ) : DataUnavailableException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1DateInterval = ( output , context ) : DateInterval => { return { End : __expectString ( output . End ) , Start : __expectString ( output . Start ) , } as any ; } ; const deserializeAws_json1_1DeleteAnomalyMonitorResponse = ( output , context ) : DeleteAnomalyMonitorResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteAnomalySubscriptionResponse = ( output , context ) : DeleteAnomalySubscriptionResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteCostCategoryDefinitionResponse = ( output , context ) : DeleteCostCategoryDefinitionResponse => { return { CostCategoryArn : __expectString ( output . CostCategoryArn ) , EffectiveEnd : __expectString ( output . EffectiveEnd ) , } as any ; } ; const deserializeAws_json1_1DescribeCostCategoryDefinitionResponse = ( output , context ) : DescribeCostCategoryDefinitionResponse => { return { CostCategory : output . CostCategory !== undefined && output . CostCategory !== null ? deserializeAws_json1_1CostCategory ( output . CostCategory , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DimensionValues = ( output , context ) : DimensionValues => { return { Key : __expectString ( output . Key ) , MatchOptions : output . MatchOptions !== undefined && output . MatchOptions !== null ? deserializeAws_json1_1MatchOptions ( output . MatchOptions , context ) : undefined , Values : output . Values !== undefined && output . Values !== null ? deserializeAws_json1_1Values ( output . Values , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DimensionValuesWithAttributes = ( output , context ) : DimensionValuesWithAttributes => { return { Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1Attributes ( output . Attributes , context ) : undefined , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1DimensionValuesWithAttributesList = ( output , context ) : DimensionValuesWithAttributes [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1DimensionValuesWithAttributes ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DiskResourceUtilization = ( output , context ) : DiskResourceUtilization => { return { DiskReadBytesPerSecond : __expectString ( output . DiskReadBytesPerSecond ) , DiskReadOpsPerSecond : __expectString ( output . DiskReadOpsPerSecond ) , DiskWriteBytesPerSecond : __expectString ( output . DiskWriteBytesPerSecond ) , DiskWriteOpsPerSecond : __expectString ( output . DiskWriteOpsPerSecond ) , } as any ; } ; const deserializeAws_json1_1EBSResourceUtilization = ( output , context ) : EBSResourceUtilization => { return { EbsReadBytesPerSecond : __expectString ( output . EbsReadBytesPerSecond ) , EbsReadOpsPerSecond : __expectString ( output . EbsReadOpsPerSecond ) , EbsWriteBytesPerSecond : __expectString ( output . EbsWriteBytesPerSecond ) , EbsWriteOpsPerSecond : __expectString ( output . EbsWriteOpsPerSecond ) , } as any ; } ; const deserializeAws_json1_1EC2InstanceDetails = ( output , context ) : EC2InstanceDetails => { return { AvailabilityZone : __expectString ( output . AvailabilityZone ) , CurrentGeneration : __expectBoolean ( output . CurrentGeneration ) , Family : __expectString ( output . Family ) , InstanceType : __expectString ( output . InstanceType ) , Platform : __expectString ( output . Platform ) , Region : __expectString ( output . Region ) , SizeFlexEligible : __expectBoolean ( output . SizeFlexEligible ) , Tenancy : __expectString ( output . Tenancy ) , } as any ; } ; const deserializeAws_json1_1EC2ResourceDetails = ( output , context ) : EC2ResourceDetails => { return { HourlyOnDemandRate : __expectString ( output . HourlyOnDemandRate ) , InstanceType : __expectString ( output . InstanceType ) , Memory : __expectString ( output . Memory ) , NetworkPerformance : __expectString ( output . NetworkPerformance ) , Platform : __expectString ( output . Platform ) , Region : __expectString ( output . Region ) , Sku : __expectString ( output . Sku ) , Storage : __expectString ( output . Storage ) , Vcpu : __expectString ( output . Vcpu ) , } as any ; } ; const deserializeAws_json1_1EC2ResourceUtilization = ( output , context ) : EC2ResourceUtilization => { return { DiskResourceUtilization : output . DiskResourceUtilization !== undefined && output . DiskResourceUtilization !== null ? deserializeAws_json1_1DiskResourceUtilization ( output . DiskResourceUtilization , context ) : undefined , EBSResourceUtilization : output . EBSResourceUtilization !== undefined && output . EBSResourceUtilization !== null ? deserializeAws_json1_1EBSResourceUtilization ( output . EBSResourceUtilization , context ) : undefined , MaxCpuUtilizationPercentage : __expectString ( output . MaxCpuUtilizationPercentage ) , MaxMemoryUtilizationPercentage : __expectString ( output . MaxMemoryUtilizationPercentage ) , MaxStorageUtilizationPercentage : __expectString ( output . MaxStorageUtilizationPercentage ) , NetworkResourceUtilization : output . NetworkResourceUtilization !== undefined && output . NetworkResourceUtilization !== null ? deserializeAws_json1_1NetworkResourceUtilization ( output . NetworkResourceUtilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1EC2Specification = ( output , context ) : EC2Specification => { return { OfferingClass : __expectString ( output . OfferingClass ) , } as any ; } ; const deserializeAws_json1_1ElastiCacheInstanceDetails = ( output , context ) : ElastiCacheInstanceDetails => { return { CurrentGeneration : __expectBoolean ( output . CurrentGeneration ) , Family : __expectString ( output . Family ) , NodeType : __expectString ( output . NodeType ) , ProductDescription : __expectString ( output . ProductDescription ) , Region : __expectString ( output . Region ) , SizeFlexEligible : __expectBoolean ( output . SizeFlexEligible ) , } as any ; } ; const deserializeAws_json1_1ESInstanceDetails = ( output , context ) : ESInstanceDetails => { return { CurrentGeneration : __expectBoolean ( output . CurrentGeneration ) , InstanceClass : __expectString ( output . InstanceClass ) , InstanceSize : __expectString ( output . InstanceSize ) , Region : __expectString ( output . Region ) , SizeFlexEligible : __expectBoolean ( output . SizeFlexEligible ) , } as any ; } ; const deserializeAws_json1_1Expression = ( output , context ) : Expression => { return { And : output . And !== undefined && output . And !== null ? deserializeAws_json1_1Expressions ( output . And , context ) : undefined , CostCategories : output . CostCategories !== undefined && output . CostCategories !== null ? deserializeAws_json1_1CostCategoryValues ( output . CostCategories , context ) : undefined , Dimensions : output . Dimensions !== undefined && output . Dimensions !== null ? deserializeAws_json1_1DimensionValues ( output . Dimensions , context ) : undefined , Not : output . Not !== undefined && output . Not !== null ? deserializeAws_json1_1Expression ( output . Not , context ) : undefined , Or : output . Or !== undefined && output . Or !== null ? deserializeAws_json1_1Expressions ( output . Or , context ) : undefined , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagValues ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Expressions = ( output , context ) : Expression [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Expression ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FindingReasonCodes = ( output , context ) : ( FindingReasonCode | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1ForecastResult = ( output , context ) : ForecastResult => { return { MeanValue : __expectString ( output . MeanValue ) , PredictionIntervalLowerBound : __expectString ( output . PredictionIntervalLowerBound ) , PredictionIntervalUpperBound : __expectString ( output . PredictionIntervalUpperBound ) , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ForecastResultsByTime = ( output , context ) : ForecastResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ForecastResult ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GetAnomaliesResponse = ( output , context ) : GetAnomaliesResponse => { return { Anomalies : output . Anomalies !== undefined && output . Anomalies !== null ? deserializeAws_json1_1Anomalies ( output . Anomalies , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , } as any ; } ; const deserializeAws_json1_1GetAnomalyMonitorsResponse = ( output , context ) : GetAnomalyMonitorsResponse => { return { AnomalyMonitors : output . AnomalyMonitors !== undefined && output . AnomalyMonitors !== null ? deserializeAws_json1_1AnomalyMonitors ( output . AnomalyMonitors , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , } as any ; } ; const deserializeAws_json1_1GetAnomalySubscriptionsResponse = ( output , context ) : GetAnomalySubscriptionsResponse => { return { AnomalySubscriptions : output . AnomalySubscriptions !== undefined && output . AnomalySubscriptions !== null ? deserializeAws_json1_1AnomalySubscriptions ( output . AnomalySubscriptions , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , } as any ; } ; const deserializeAws_json1_1GetCostAndUsageResponse = ( output , context ) : GetCostAndUsageResponse => { return { DimensionValueAttributes : output . DimensionValueAttributes !== undefined && output . DimensionValueAttributes !== null ? deserializeAws_json1_1DimensionValuesWithAttributesList ( output . DimensionValueAttributes , context ) : undefined , GroupDefinitions : output . GroupDefinitions !== undefined && output . GroupDefinitions !== null ? deserializeAws_json1_1GroupDefinitions ( output . GroupDefinitions , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , ResultsByTime : output . ResultsByTime !== undefined && output . ResultsByTime !== null ? deserializeAws_json1_1ResultsByTime ( output . ResultsByTime , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetCostAndUsageWithResourcesResponse = ( output , context ) : GetCostAndUsageWithResourcesResponse => { return { DimensionValueAttributes : output . DimensionValueAttributes !== undefined && output . DimensionValueAttributes !== null ? deserializeAws_json1_1DimensionValuesWithAttributesList ( output . DimensionValueAttributes , context ) : undefined , GroupDefinitions : output . GroupDefinitions !== undefined && output . GroupDefinitions !== null ? deserializeAws_json1_1GroupDefinitions ( output . GroupDefinitions , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , ResultsByTime : output . ResultsByTime !== undefined && output . ResultsByTime !== null ? deserializeAws_json1_1ResultsByTime ( output . ResultsByTime , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetCostCategoriesResponse = ( output , context ) : GetCostCategoriesResponse => { return { CostCategoryNames : output . CostCategoryNames !== undefined && output . CostCategoryNames !== null ? deserializeAws_json1_1CostCategoryNamesList ( output . CostCategoryNames , context ) : undefined , CostCategoryValues : output . CostCategoryValues !== undefined && output . CostCategoryValues !== null ? deserializeAws_json1_1CostCategoryValuesList ( output . CostCategoryValues , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , ReturnSize : __expectInt32 ( output . ReturnSize ) , TotalSize : __expectInt32 ( output . TotalSize ) , } as any ; } ; const deserializeAws_json1_1GetCostForecastResponse = ( output , context ) : GetCostForecastResponse => { return { ForecastResultsByTime : output . ForecastResultsByTime !== undefined && output . ForecastResultsByTime !== null ? deserializeAws_json1_1ForecastResultsByTime ( output . ForecastResultsByTime , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1MetricValue ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetDimensionValuesResponse = ( output , context ) : GetDimensionValuesResponse => { return { DimensionValues : output . DimensionValues !== undefined && output . DimensionValues !== null ? deserializeAws_json1_1DimensionValuesWithAttributesList ( output . DimensionValues , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , ReturnSize : __expectInt32 ( output . ReturnSize ) , TotalSize : __expectInt32 ( output . TotalSize ) , } as any ; } ; const deserializeAws_json1_1GetReservationCoverageResponse = ( output , context ) : GetReservationCoverageResponse => { return { CoveragesByTime : output . CoveragesByTime !== undefined && output . CoveragesByTime !== null ? deserializeAws_json1_1CoveragesByTime ( output . CoveragesByTime , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1Coverage ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetReservationPurchaseRecommendationResponse = ( output , context ) : GetReservationPurchaseRecommendationResponse => { return { Metadata : output . Metadata !== undefined && output . Metadata !== null ? deserializeAws_json1_1ReservationPurchaseRecommendationMetadata ( output . Metadata , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , Recommendations : output . Recommendations !== undefined && output . Recommendations !== null ? deserializeAws_json1_1ReservationPurchaseRecommendations ( output . Recommendations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetReservationUtilizationResponse = ( output , context ) : GetReservationUtilizationResponse => { return { NextPageToken : __expectString ( output . NextPageToken ) , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1ReservationAggregates ( output . Total , context ) : undefined , UtilizationsByTime : output . UtilizationsByTime !== undefined && output . UtilizationsByTime !== null ? deserializeAws_json1_1UtilizationsByTime ( output . UtilizationsByTime , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetRightsizingRecommendationResponse = ( output , context ) : GetRightsizingRecommendationResponse => { return { Configuration : output . Configuration !== undefined && output . Configuration !== null ? deserializeAws_json1_1RightsizingRecommendationConfiguration ( output . Configuration , context ) : undefined , Metadata : output . Metadata !== undefined && output . Metadata !== null ? deserializeAws_json1_1RightsizingRecommendationMetadata ( output . Metadata , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , RightsizingRecommendations : output . RightsizingRecommendations !== undefined && output . RightsizingRecommendations !== null ? deserializeAws_json1_1RightsizingRecommendationList ( output . RightsizingRecommendations , context ) : undefined , Summary : output . Summary !== undefined && output . Summary !== null ? deserializeAws_json1_1RightsizingRecommendationSummary ( output . Summary , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetSavingsPlansCoverageResponse = ( output , context ) : GetSavingsPlansCoverageResponse => { return { NextToken : __expectString ( output . NextToken ) , SavingsPlansCoverages : output . SavingsPlansCoverages !== undefined && output . SavingsPlansCoverages !== null ? deserializeAws_json1_1SavingsPlansCoverages ( output . SavingsPlansCoverages , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetSavingsPlansPurchaseRecommendationResponse = ( output , context ) : GetSavingsPlansPurchaseRecommendationResponse => { return { Metadata : output . Metadata !== undefined && output . Metadata !== null ? deserializeAws_json1_1SavingsPlansPurchaseRecommendationMetadata ( output . Metadata , context ) : undefined , NextPageToken : __expectString ( output . NextPageToken ) , SavingsPlansPurchaseRecommendation : output . SavingsPlansPurchaseRecommendation !== undefined && output . SavingsPlansPurchaseRecommendation !== null ? deserializeAws_json1_1SavingsPlansPurchaseRecommendation ( output . SavingsPlansPurchaseRecommendation , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetSavingsPlansUtilizationDetailsResponse = ( output , context ) : GetSavingsPlansUtilizationDetailsResponse => { return { NextToken : __expectString ( output . NextToken ) , SavingsPlansUtilizationDetails : output . SavingsPlansUtilizationDetails !== undefined && output . SavingsPlansUtilizationDetails !== null ? deserializeAws_json1_1SavingsPlansUtilizationDetails ( output . SavingsPlansUtilizationDetails , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1SavingsPlansUtilizationAggregates ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetSavingsPlansUtilizationResponse = ( output , context ) : GetSavingsPlansUtilizationResponse => { return { SavingsPlansUtilizationsByTime : output . SavingsPlansUtilizationsByTime !== undefined && output . SavingsPlansUtilizationsByTime !== null ? deserializeAws_json1_1SavingsPlansUtilizationsByTime ( output . SavingsPlansUtilizationsByTime , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1SavingsPlansUtilizationAggregates ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetTagsResponse = ( output , context ) : GetTagsResponse => { return { NextPageToken : __expectString ( output . NextPageToken ) , ReturnSize : __expectInt32 ( output . ReturnSize ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , TotalSize : __expectInt32 ( output . TotalSize ) , } as any ; } ; const deserializeAws_json1_1GetUsageForecastResponse = ( output , context ) : GetUsageForecastResponse => { return { ForecastResultsByTime : output . ForecastResultsByTime !== undefined && output . ForecastResultsByTime !== null ? deserializeAws_json1_1ForecastResultsByTime ( output . ForecastResultsByTime , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1MetricValue ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Group = ( output , context ) : Group => { return { Keys : output . Keys !== undefined && output . Keys !== null ? deserializeAws_json1_1Keys ( output . Keys , context ) : undefined , Metrics : output . Metrics !== undefined && output . Metrics !== null ? deserializeAws_json1_1Metrics ( output . Metrics , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GroupDefinition = ( output , context ) : GroupDefinition => { return { Key : __expectString ( output . Key ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1GroupDefinitions = ( output , context ) : GroupDefinition [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GroupDefinition ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Groups = ( output , context ) : Group [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Group ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Impact = ( output , context ) : Impact => { return { MaxImpact : __limitedParseDouble ( output . MaxImpact ) , TotalImpact : __limitedParseDouble ( output . TotalImpact ) , } as any ; } ; const deserializeAws_json1_1InstanceDetails = ( output , context ) : InstanceDetails => { return { EC2InstanceDetails : output . EC2InstanceDetails !== undefined && output . EC2InstanceDetails !== null ? deserializeAws_json1_1EC2InstanceDetails ( output . EC2InstanceDetails , context ) : undefined , ESInstanceDetails : output . ESInstanceDetails !== undefined && output . ESInstanceDetails !== null ? deserializeAws_json1_1ESInstanceDetails ( output . ESInstanceDetails , context ) : undefined , ElastiCacheInstanceDetails : output . ElastiCacheInstanceDetails !== undefined && output . ElastiCacheInstanceDetails !== null ? deserializeAws_json1_1ElastiCacheInstanceDetails ( output . ElastiCacheInstanceDetails , context ) : undefined , RDSInstanceDetails : output . RDSInstanceDetails !== undefined && output . RDSInstanceDetails !== null ? deserializeAws_json1_1RDSInstanceDetails ( output . RDSInstanceDetails , context ) : undefined , RedshiftInstanceDetails : output . RedshiftInstanceDetails !== undefined && output . RedshiftInstanceDetails !== null ? deserializeAws_json1_1RedshiftInstanceDetails ( output . RedshiftInstanceDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1InvalidNextTokenException = ( output , context ) : InvalidNextTokenException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1Keys = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1LimitExceededException = ( output , context ) : LimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ListCostCategoryDefinitionsResponse = ( output , context ) : ListCostCategoryDefinitionsResponse => { return { CostCategoryReferences : output . CostCategoryReferences !== undefined && output . CostCategoryReferences !== null ? deserializeAws_json1_1CostCategoryReferencesList ( output . CostCategoryReferences , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1MatchOptions = ( output , context ) : ( MatchOption | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1Metrics = ( output , context ) : { [ key ] : MetricValue ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_json1_1MetricValue ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_json1_1MetricValue = ( output , context ) : MetricValue => { return { Amount : __expectString ( output . Amount ) , Unit : __expectString ( output . Unit ) , } as any ; } ; const deserializeAws_json1_1ModifyRecommendationDetail = ( output , context ) : ModifyRecommendationDetail => { return { TargetInstances : output . TargetInstances !== undefined && output . TargetInstances !== null ? deserializeAws_json1_1TargetInstancesList ( output . TargetInstances , context ) : undefined , } as any ; } ; const deserializeAws_json1_1MonitorArnList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1NetworkResourceUtilization = ( output , context ) : NetworkResourceUtilization => { return { NetworkInBytesPerSecond : __expectString ( output . NetworkInBytesPerSecond ) , NetworkOutBytesPerSecond : __expectString ( output . NetworkOutBytesPerSecond ) , NetworkPacketsInPerSecond : __expectString ( output . NetworkPacketsInPerSecond ) , NetworkPacketsOutPerSecond : __expectString ( output . NetworkPacketsOutPerSecond ) , } as any ; } ; const deserializeAws_json1_1PlatformDifferences = ( output , context ) : ( PlatformDifference | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1ProvideAnomalyFeedbackResponse = ( output , context ) : ProvideAnomalyFeedbackResponse => { return { AnomalyId : __expectString ( output . AnomalyId ) , } as any ; } ; const deserializeAws_json1_1RDSInstanceDetails = ( output , context ) : RDSInstanceDetails => { return { CurrentGeneration : __expectBoolean ( output . CurrentGeneration ) , DatabaseEdition : __expectString ( output . DatabaseEdition ) , DatabaseEngine : __expectString ( output . DatabaseEngine ) , DeploymentOption : __expectString ( output . DeploymentOption ) , Family : __expectString ( output . Family ) , InstanceType : __expectString ( output . InstanceType ) , LicenseModel : __expectString ( output . LicenseModel ) , Region : __expectString ( output . Region ) , SizeFlexEligible : __expectBoolean ( output . SizeFlexEligible ) , } as any ; } ; const deserializeAws_json1_1RedshiftInstanceDetails = ( output , context ) : RedshiftInstanceDetails => { return { CurrentGeneration : __expectBoolean ( output . CurrentGeneration ) , Family : __expectString ( output . Family ) , NodeType : __expectString ( output . NodeType ) , Region : __expectString ( output . Region ) , SizeFlexEligible : __expectBoolean ( output . SizeFlexEligible ) , } as any ; } ; const deserializeAws_json1_1RequestChangedException = ( output , context ) : RequestChangedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ReservationAggregates = ( output , context ) : ReservationAggregates => { return { AmortizedRecurringFee : __expectString ( output . AmortizedRecurringFee ) , AmortizedUpfrontFee : __expectString ( output . AmortizedUpfrontFee ) , NetRISavings : __expectString ( output . NetRISavings ) , OnDemandCostOfRIHoursUsed : __expectString ( output . OnDemandCostOfRIHoursUsed ) , PurchasedHours : __expectString ( output . PurchasedHours ) , PurchasedUnits : __expectString ( output . PurchasedUnits ) , RICostForUnusedHours : __expectString ( output . RICostForUnusedHours ) , RealizedSavings : __expectString ( output . RealizedSavings ) , TotalActualHours : __expectString ( output . TotalActualHours ) , TotalActualUnits : __expectString ( output . TotalActualUnits ) , TotalAmortizedFee : __expectString ( output . TotalAmortizedFee ) , TotalPotentialRISavings : __expectString ( output . TotalPotentialRISavings ) , UnrealizedSavings : __expectString ( output . UnrealizedSavings ) , UnusedHours : __expectString ( output . UnusedHours ) , UnusedUnits : __expectString ( output . UnusedUnits ) , UtilizationPercentage : __expectString ( output . UtilizationPercentage ) , UtilizationPercentageInUnits : __expectString ( output . UtilizationPercentageInUnits ) , } as any ; } ; const deserializeAws_json1_1ReservationCoverageGroup = ( output , context ) : ReservationCoverageGroup => { return { Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1Attributes ( output . Attributes , context ) : undefined , Coverage : output . Coverage !== undefined && output . Coverage !== null ? deserializeAws_json1_1Coverage ( output . Coverage , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReservationCoverageGroups = ( output , context ) : ReservationCoverageGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReservationCoverageGroup ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendation = ( output , context ) : ReservationPurchaseRecommendation => { return { AccountScope : __expectString ( output . AccountScope ) , LookbackPeriodInDays : __expectString ( output . LookbackPeriodInDays ) , PaymentOption : __expectString ( output . PaymentOption ) , RecommendationDetails : output . RecommendationDetails !== undefined && output . RecommendationDetails !== null ? deserializeAws_json1_1ReservationPurchaseRecommendationDetails ( output . RecommendationDetails , context ) : undefined , RecommendationSummary : output . RecommendationSummary !== undefined && output . RecommendationSummary !== null ? deserializeAws_json1_1ReservationPurchaseRecommendationSummary ( output . RecommendationSummary , context ) : undefined , ServiceSpecification : output . ServiceSpecification !== undefined && output . ServiceSpecification !== null ? deserializeAws_json1_1ServiceSpecification ( output . ServiceSpecification , context ) : undefined , TermInYears : __expectString ( output . TermInYears ) , } as any ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendationDetail = ( output , context ) : ReservationPurchaseRecommendationDetail => { return { AccountId : __expectString ( output . AccountId ) , AverageNormalizedUnitsUsedPerHour : __expectString ( output . AverageNormalizedUnitsUsedPerHour ) , AverageNumberOfInstancesUsedPerHour : __expectString ( output . AverageNumberOfInstancesUsedPerHour ) , AverageUtilization : __expectString ( output . AverageUtilization ) , CurrencyCode : __expectString ( output . CurrencyCode ) , EstimatedBreakEvenInMonths : __expectString ( output . EstimatedBreakEvenInMonths ) , EstimatedMonthlyOnDemandCost : __expectString ( output . EstimatedMonthlyOnDemandCost ) , EstimatedMonthlySavingsAmount : __expectString ( output . EstimatedMonthlySavingsAmount ) , EstimatedMonthlySavingsPercentage : __expectString ( output . EstimatedMonthlySavingsPercentage ) , EstimatedReservationCostForLookbackPeriod : __expectString ( output . EstimatedReservationCostForLookbackPeriod ) , InstanceDetails : output . InstanceDetails !== undefined && output . InstanceDetails !== null ? deserializeAws_json1_1InstanceDetails ( output . InstanceDetails , context ) : undefined , MaximumNormalizedUnitsUsedPerHour : __expectString ( output . MaximumNormalizedUnitsUsedPerHour ) , MaximumNumberOfInstancesUsedPerHour : __expectString ( output . MaximumNumberOfInstancesUsedPerHour ) , MinimumNormalizedUnitsUsedPerHour : __expectString ( output . MinimumNormalizedUnitsUsedPerHour ) , MinimumNumberOfInstancesUsedPerHour : __expectString ( output . MinimumNumberOfInstancesUsedPerHour ) , RecommendedNormalizedUnitsToPurchase : __expectString ( output . RecommendedNormalizedUnitsToPurchase ) , RecommendedNumberOfInstancesToPurchase : __expectString ( output . RecommendedNumberOfInstancesToPurchase ) , RecurringStandardMonthlyCost : __expectString ( output . RecurringStandardMonthlyCost ) , UpfrontCost : __expectString ( output . UpfrontCost ) , } as any ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendationDetails = ( output , context ) : ReservationPurchaseRecommendationDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReservationPurchaseRecommendationDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendationMetadata = ( output , context ) : ReservationPurchaseRecommendationMetadata => { return { GenerationTimestamp : __expectString ( output . GenerationTimestamp ) , RecommendationId : __expectString ( output . RecommendationId ) , } as any ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendations = ( output , context ) : ReservationPurchaseRecommendation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReservationPurchaseRecommendation ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ReservationPurchaseRecommendationSummary = ( output , context ) : ReservationPurchaseRecommendationSummary => { return { CurrencyCode : __expectString ( output . CurrencyCode ) , TotalEstimatedMonthlySavingsAmount : __expectString ( output . TotalEstimatedMonthlySavingsAmount ) , TotalEstimatedMonthlySavingsPercentage : __expectString ( output . TotalEstimatedMonthlySavingsPercentage ) , } as any ; } ; const deserializeAws_json1_1ReservationUtilizationGroup = ( output , context ) : ReservationUtilizationGroup => { return { Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1Attributes ( output . Attributes , context ) : undefined , Key : __expectString ( output . Key ) , Utilization : output . Utilization !== undefined && output . Utilization !== null ? deserializeAws_json1_1ReservationAggregates ( output . Utilization , context ) : undefined , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1ReservationUtilizationGroups = ( output , context ) : ReservationUtilizationGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReservationUtilizationGroup ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ResourceDetails = ( output , context ) : ResourceDetails => { return { EC2ResourceDetails : output . EC2ResourceDetails !== undefined && output . EC2ResourceDetails !== null ? deserializeAws_json1_1EC2ResourceDetails ( output . EC2ResourceDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ResourceUtilization = ( output , context ) : ResourceUtilization => { return { EC2ResourceUtilization : output . EC2ResourceUtilization !== undefined && output . EC2ResourceUtilization !== null ? deserializeAws_json1_1EC2ResourceUtilization ( output . EC2ResourceUtilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResultByTime = ( output , context ) : ResultByTime => { return { Estimated : __expectBoolean ( output . Estimated ) , Groups : output . Groups !== undefined && output . Groups !== null ? deserializeAws_json1_1Groups ( output . Groups , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1Metrics ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResultsByTime = ( output , context ) : ResultByTime [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ResultByTime ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RightsizingRecommendation = ( output , context ) : RightsizingRecommendation => { return { AccountId : __expectString ( output . AccountId ) , CurrentInstance : output . CurrentInstance !== undefined && output . CurrentInstance !== null ? deserializeAws_json1_1CurrentInstance ( output . CurrentInstance , context ) : undefined , FindingReasonCodes : output . FindingReasonCodes !== undefined && output . FindingReasonCodes !== null ? deserializeAws_json1_1FindingReasonCodes ( output . FindingReasonCodes , context ) : undefined , ModifyRecommendationDetail : output . ModifyRecommendationDetail !== undefined && output . ModifyRecommendationDetail !== null ? deserializeAws_json1_1ModifyRecommendationDetail ( output . ModifyRecommendationDetail , context ) : undefined , RightsizingType : __expectString ( output . RightsizingType ) , TerminateRecommendationDetail : output . TerminateRecommendationDetail !== undefined && output . TerminateRecommendationDetail !== null ? deserializeAws_json1_1TerminateRecommendationDetail ( output . TerminateRecommendationDetail , context ) : undefined , } as any ; } ; const deserializeAws_json1_1RightsizingRecommendationConfiguration = ( output , context ) : RightsizingRecommendationConfiguration => { return { BenefitsConsidered : __expectBoolean ( output . BenefitsConsidered ) , RecommendationTarget : __expectString ( output . RecommendationTarget ) , } as any ; } ; const deserializeAws_json1_1RightsizingRecommendationList = ( output , context ) : RightsizingRecommendation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RightsizingRecommendation ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RightsizingRecommendationMetadata = ( output , context ) : RightsizingRecommendationMetadata => { return { AdditionalMetadata : __expectString ( output . AdditionalMetadata ) , GenerationTimestamp : __expectString ( output . GenerationTimestamp ) , LookbackPeriodInDays : __expectString ( output . LookbackPeriodInDays ) , RecommendationId : __expectString ( output . RecommendationId ) , } as any ; } ; const deserializeAws_json1_1RightsizingRecommendationSummary = ( output , context ) : RightsizingRecommendationSummary => { return { EstimatedTotalMonthlySavingsAmount : __expectString ( output . EstimatedTotalMonthlySavingsAmount ) , SavingsCurrencyCode : __expectString ( output . SavingsCurrencyCode ) , SavingsPercentage : __expectString ( output . SavingsPercentage ) , TotalRecommendationCount : __expectString ( output . TotalRecommendationCount ) , } as any ; } ; const deserializeAws_json1_1RootCause = ( output , context ) : RootCause => { return { LinkedAccount : __expectString ( output . LinkedAccount ) , Region : __expectString ( output . Region ) , Service : __expectString ( output . Service ) , UsageType : __expectString ( output . UsageType ) , } as any ; } ; const deserializeAws_json1_1RootCauses = ( output , context ) : RootCause [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RootCause ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SavingsPlansAmortizedCommitment = ( output , context ) : SavingsPlansAmortizedCommitment => { return { AmortizedRecurringCommitment : __expectString ( output . AmortizedRecurringCommitment ) , AmortizedUpfrontCommitment : __expectString ( output . AmortizedUpfrontCommitment ) , TotalAmortizedCommitment : __expectString ( output . TotalAmortizedCommitment ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansCoverage = ( output , context ) : SavingsPlansCoverage => { return { Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1Attributes ( output . Attributes , context ) : undefined , Coverage : output . Coverage !== undefined && output . Coverage !== null ? deserializeAws_json1_1SavingsPlansCoverageData ( output . Coverage , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SavingsPlansCoverageData = ( output , context ) : SavingsPlansCoverageData => { return { CoveragePercentage : __expectString ( output . CoveragePercentage ) , OnDemandCost : __expectString ( output . OnDemandCost ) , SpendCoveredBySavingsPlans : __expectString ( output . SpendCoveredBySavingsPlans ) , TotalCost : __expectString ( output . TotalCost ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansCoverages = ( output , context ) : SavingsPlansCoverage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1SavingsPlansCoverage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SavingsPlansDetails = ( output , context ) : SavingsPlansDetails => { return { InstanceFamily : __expectString ( output . InstanceFamily ) , OfferingId : __expectString ( output . OfferingId ) , Region : __expectString ( output . Region ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansPurchaseRecommendation = ( output , context ) : SavingsPlansPurchaseRecommendation => { return { AccountScope : __expectString ( output . AccountScope ) , LookbackPeriodInDays : __expectString ( output . LookbackPeriodInDays ) , PaymentOption : __expectString ( output . PaymentOption ) , SavingsPlansPurchaseRecommendationDetails : output . SavingsPlansPurchaseRecommendationDetails !== undefined && output . SavingsPlansPurchaseRecommendationDetails !== null ? deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetailList ( output . SavingsPlansPurchaseRecommendationDetails , context ) : undefined , SavingsPlansPurchaseRecommendationSummary : output . SavingsPlansPurchaseRecommendationSummary !== undefined && output . SavingsPlansPurchaseRecommendationSummary !== null ? deserializeAws_json1_1SavingsPlansPurchaseRecommendationSummary ( output . SavingsPlansPurchaseRecommendationSummary , context ) : undefined , SavingsPlansType : __expectString ( output . SavingsPlansType ) , TermInYears : __expectString ( output . TermInYears ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetail = ( output , context ) : SavingsPlansPurchaseRecommendationDetail => { return { AccountId : __expectString ( output . AccountId ) , CurrencyCode : __expectString ( output . CurrencyCode ) , CurrentAverageHourlyOnDemandSpend : __expectString ( output . CurrentAverageHourlyOnDemandSpend ) , CurrentMaximumHourlyOnDemandSpend : __expectString ( output . CurrentMaximumHourlyOnDemandSpend ) , CurrentMinimumHourlyOnDemandSpend : __expectString ( output . CurrentMinimumHourlyOnDemandSpend ) , EstimatedAverageUtilization : __expectString ( output . EstimatedAverageUtilization ) , EstimatedMonthlySavingsAmount : __expectString ( output . EstimatedMonthlySavingsAmount ) , EstimatedOnDemandCost : __expectString ( output . EstimatedOnDemandCost ) , EstimatedOnDemandCostWithCurrentCommitment : __expectString ( output . EstimatedOnDemandCostWithCurrentCommitment ) , EstimatedROI : __expectString ( output . EstimatedROI ) , EstimatedSPCost : __expectString ( output . EstimatedSPCost ) , EstimatedSavingsAmount : __expectString ( output . EstimatedSavingsAmount ) , EstimatedSavingsPercentage : __expectString ( output . EstimatedSavingsPercentage ) , HourlyCommitmentToPurchase : __expectString ( output . HourlyCommitmentToPurchase ) , SavingsPlansDetails : output . SavingsPlansDetails !== undefined && output . SavingsPlansDetails !== null ? deserializeAws_json1_1SavingsPlansDetails ( output . SavingsPlansDetails , context ) : undefined , UpfrontCost : __expectString ( output . UpfrontCost ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetailList = ( output , context ) : SavingsPlansPurchaseRecommendationDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1SavingsPlansPurchaseRecommendationDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SavingsPlansPurchaseRecommendationMetadata = ( output , context ) : SavingsPlansPurchaseRecommendationMetadata => { return { AdditionalMetadata : __expectString ( output . AdditionalMetadata ) , GenerationTimestamp : __expectString ( output . GenerationTimestamp ) , RecommendationId : __expectString ( output . RecommendationId ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansPurchaseRecommendationSummary = ( output , context ) : SavingsPlansPurchaseRecommendationSummary => { return { CurrencyCode : __expectString ( output . CurrencyCode ) , CurrentOnDemandSpend : __expectString ( output . CurrentOnDemandSpend ) , DailyCommitmentToPurchase : __expectString ( output . DailyCommitmentToPurchase ) , EstimatedMonthlySavingsAmount : __expectString ( output . EstimatedMonthlySavingsAmount ) , EstimatedOnDemandCostWithCurrentCommitment : __expectString ( output . EstimatedOnDemandCostWithCurrentCommitment ) , EstimatedROI : __expectString ( output . EstimatedROI ) , EstimatedSavingsAmount : __expectString ( output . EstimatedSavingsAmount ) , EstimatedSavingsPercentage : __expectString ( output . EstimatedSavingsPercentage ) , EstimatedTotalCost : __expectString ( output . EstimatedTotalCost ) , HourlyCommitmentToPurchase : __expectString ( output . HourlyCommitmentToPurchase ) , TotalRecommendationCount : __expectString ( output . TotalRecommendationCount ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansSavings = ( output , context ) : SavingsPlansSavings => { return { NetSavings : __expectString ( output . NetSavings ) , OnDemandCostEquivalent : __expectString ( output . OnDemandCostEquivalent ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansUtilization = ( output , context ) : SavingsPlansUtilization => { return { TotalCommitment : __expectString ( output . TotalCommitment ) , UnusedCommitment : __expectString ( output . UnusedCommitment ) , UsedCommitment : __expectString ( output . UsedCommitment ) , UtilizationPercentage : __expectString ( output . UtilizationPercentage ) , } as any ; } ; const deserializeAws_json1_1SavingsPlansUtilizationAggregates = ( output , context ) : SavingsPlansUtilizationAggregates => { return { AmortizedCommitment : output . AmortizedCommitment !== undefined && output . AmortizedCommitment !== null ? deserializeAws_json1_1SavingsPlansAmortizedCommitment ( output . AmortizedCommitment , context ) : undefined , Savings : output . Savings !== undefined && output . Savings !== null ? deserializeAws_json1_1SavingsPlansSavings ( output . Savings , context ) : undefined , Utilization : output . Utilization !== undefined && output . Utilization !== null ? deserializeAws_json1_1SavingsPlansUtilization ( output . Utilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SavingsPlansUtilizationByTime = ( output , context ) : SavingsPlansUtilizationByTime => { return { AmortizedCommitment : output . AmortizedCommitment !== undefined && output . AmortizedCommitment !== null ? deserializeAws_json1_1SavingsPlansAmortizedCommitment ( output . AmortizedCommitment , context ) : undefined , Savings : output . Savings !== undefined && output . Savings !== null ? deserializeAws_json1_1SavingsPlansSavings ( output . Savings , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , Utilization : output . Utilization !== undefined && output . Utilization !== null ? deserializeAws_json1_1SavingsPlansUtilization ( output . Utilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SavingsPlansUtilizationDetail = ( output , context ) : SavingsPlansUtilizationDetail => { return { AmortizedCommitment : output . AmortizedCommitment !== undefined && output . AmortizedCommitment !== null ? deserializeAws_json1_1SavingsPlansAmortizedCommitment ( output . AmortizedCommitment , context ) : undefined , Attributes : output . Attributes !== undefined && output . Attributes !== null ? deserializeAws_json1_1Attributes ( output . Attributes , context ) : undefined , Savings : output . Savings !== undefined && output . Savings !== null ? deserializeAws_json1_1SavingsPlansSavings ( output . Savings , context ) : undefined , SavingsPlanArn : __expectString ( output . SavingsPlanArn ) , Utilization : output . Utilization !== undefined && output . Utilization !== null ? deserializeAws_json1_1SavingsPlansUtilization ( output . Utilization , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SavingsPlansUtilizationDetails = ( output , context ) : SavingsPlansUtilizationDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1SavingsPlansUtilizationDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1SavingsPlansUtilizationsByTime = ( output , context ) : SavingsPlansUtilizationByTime [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1SavingsPlansUtilizationByTime ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ServiceQuotaExceededException = ( output , context ) : ServiceQuotaExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ServiceSpecification = ( output , context ) : ServiceSpecification => { return { EC2Specification : output . EC2Specification !== undefined && output . EC2Specification !== null ? deserializeAws_json1_1EC2Specification ( output . EC2Specification , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Subscriber = ( output , context ) : Subscriber => { return { Address : __expectString ( output . Address ) , Status : __expectString ( output . Status ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1Subscribers = ( output , context ) : Subscriber [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Subscriber ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TagList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1TagValues = ( output , context ) : TagValues => { return { Key : __expectString ( output . Key ) , MatchOptions : output . MatchOptions !== undefined && output . MatchOptions !== null ? deserializeAws_json1_1MatchOptions ( output . MatchOptions , context ) : undefined , Values : output . Values !== undefined && output . Values !== null ? deserializeAws_json1_1Values ( output . Values , context ) : undefined , } as any ; } ; const deserializeAws_json1_1TagValuesList = ( output , context ) : TagValues [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1TagValues ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TargetInstance = ( output , context ) : TargetInstance => { return { CurrencyCode : __expectString ( output . CurrencyCode ) , DefaultTargetInstance : __expectBoolean ( output . DefaultTargetInstance ) , EstimatedMonthlyCost : __expectString ( output . EstimatedMonthlyCost ) , EstimatedMonthlySavings : __expectString ( output . EstimatedMonthlySavings ) , ExpectedResourceUtilization : output . ExpectedResourceUtilization !== undefined && output . ExpectedResourceUtilization !== null ? deserializeAws_json1_1ResourceUtilization ( output . ExpectedResourceUtilization , context ) : undefined , PlatformDifferences : output . PlatformDifferences !== undefined && output . PlatformDifferences !== null ? deserializeAws_json1_1PlatformDifferences ( output . PlatformDifferences , context ) : undefined , ResourceDetails : output . ResourceDetails !== undefined && output . ResourceDetails !== null ? deserializeAws_json1_1ResourceDetails ( output . ResourceDetails , context ) : undefined , } as any ; } ; const deserializeAws_json1_1TargetInstancesList = ( output , context ) : TargetInstance [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1TargetInstance ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TerminateRecommendationDetail = ( output , context ) : TerminateRecommendationDetail => { return { CurrencyCode : __expectString ( output . CurrencyCode ) , EstimatedMonthlySavings : __expectString ( output . EstimatedMonthlySavings ) , } as any ; } ; const deserializeAws_json1_1UnknownMonitorException = ( output , context ) : UnknownMonitorException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UnknownSubscriptionException = ( output , context ) : UnknownSubscriptionException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UnresolvableUsageUnitException = ( output , context ) : UnresolvableUsageUnitException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UpdateAnomalyMonitorResponse = ( output , context ) : UpdateAnomalyMonitorResponse => { return { MonitorArn : __expectString ( output . MonitorArn ) , } as any ; } ; const deserializeAws_json1_1UpdateAnomalySubscriptionResponse = ( output , context ) : UpdateAnomalySubscriptionResponse => { return { SubscriptionArn : __expectString ( output . SubscriptionArn ) , } as any ; } ; const deserializeAws_json1_1UpdateCostCategoryDefinitionResponse = ( output , context ) : UpdateCostCategoryDefinitionResponse => { return { CostCategoryArn : __expectString ( output . CostCategoryArn ) , EffectiveStart : __expectString ( output . EffectiveStart ) , } as any ; } ; const deserializeAws_json1_1UtilizationByTime = ( output , context ) : UtilizationByTime => { return { Groups : output . Groups !== undefined && output . Groups !== null ? deserializeAws_json1_1ReservationUtilizationGroups ( output . Groups , context ) : undefined , TimePeriod : output . TimePeriod !== undefined && output . TimePeriod !== null ? deserializeAws_json1_1DateInterval ( output . TimePeriod , context ) : undefined , Total : output . Total !== undefined && output . Total !== null ? deserializeAws_json1_1ReservationAggregates ( output . Total , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UtilizationsByTime = ( output , context ) : UtilizationByTime [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1UtilizationByTime ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Values = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) 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 "" ; } ;