import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { AcceptGrantCommandInput , AcceptGrantCommandOutput } from "../commands/AcceptGrantCommand" ; import { CheckInLicenseCommandInput , CheckInLicenseCommandOutput } from "../commands/CheckInLicenseCommand" ; import { CheckoutBorrowLicenseCommandInput , CheckoutBorrowLicenseCommandOutput , } from "../commands/CheckoutBorrowLicenseCommand" ; import { CheckoutLicenseCommandInput , CheckoutLicenseCommandOutput } from "../commands/CheckoutLicenseCommand" ; import { CreateGrantCommandInput , CreateGrantCommandOutput } from "../commands/CreateGrantCommand" ; import { CreateGrantVersionCommandInput , CreateGrantVersionCommandOutput } from "../commands/CreateGrantVersionCommand" ; import { CreateLicenseCommandInput , CreateLicenseCommandOutput } from "../commands/CreateLicenseCommand" ; import { CreateLicenseConfigurationCommandInput , CreateLicenseConfigurationCommandOutput , } from "../commands/CreateLicenseConfigurationCommand" ; import { CreateLicenseConversionTaskForResourceCommandInput , CreateLicenseConversionTaskForResourceCommandOutput , } from "../commands/CreateLicenseConversionTaskForResourceCommand" ; import { CreateLicenseManagerReportGeneratorCommandInput , CreateLicenseManagerReportGeneratorCommandOutput , } from "../commands/CreateLicenseManagerReportGeneratorCommand" ; import { CreateLicenseVersionCommandInput , CreateLicenseVersionCommandOutput , } from "../commands/CreateLicenseVersionCommand" ; import { CreateTokenCommandInput , CreateTokenCommandOutput } from "../commands/CreateTokenCommand" ; import { DeleteGrantCommandInput , DeleteGrantCommandOutput } from "../commands/DeleteGrantCommand" ; import { DeleteLicenseCommandInput , DeleteLicenseCommandOutput } from "../commands/DeleteLicenseCommand" ; import { DeleteLicenseConfigurationCommandInput , DeleteLicenseConfigurationCommandOutput , } from "../commands/DeleteLicenseConfigurationCommand" ; import { DeleteLicenseManagerReportGeneratorCommandInput , DeleteLicenseManagerReportGeneratorCommandOutput , } from "../commands/DeleteLicenseManagerReportGeneratorCommand" ; import { DeleteTokenCommandInput , DeleteTokenCommandOutput } from "../commands/DeleteTokenCommand" ; import { ExtendLicenseConsumptionCommandInput , ExtendLicenseConsumptionCommandOutput , } from "../commands/ExtendLicenseConsumptionCommand" ; import { GetAccessTokenCommandInput , GetAccessTokenCommandOutput } from "../commands/GetAccessTokenCommand" ; import { GetGrantCommandInput , GetGrantCommandOutput } from "../commands/GetGrantCommand" ; import { GetLicenseCommandInput , GetLicenseCommandOutput } from "../commands/GetLicenseCommand" ; import { GetLicenseConfigurationCommandInput , GetLicenseConfigurationCommandOutput , } from "../commands/GetLicenseConfigurationCommand" ; import { GetLicenseConversionTaskCommandInput , GetLicenseConversionTaskCommandOutput , } from "../commands/GetLicenseConversionTaskCommand" ; import { GetLicenseManagerReportGeneratorCommandInput , GetLicenseManagerReportGeneratorCommandOutput , } from "../commands/GetLicenseManagerReportGeneratorCommand" ; import { GetLicenseUsageCommandInput , GetLicenseUsageCommandOutput } from "../commands/GetLicenseUsageCommand" ; import { GetServiceSettingsCommandInput , GetServiceSettingsCommandOutput } from "../commands/GetServiceSettingsCommand" ; import { ListAssociationsForLicenseConfigurationCommandInput , ListAssociationsForLicenseConfigurationCommandOutput , } from "../commands/ListAssociationsForLicenseConfigurationCommand" ; import { ListDistributedGrantsCommandInput , ListDistributedGrantsCommandOutput , } from "../commands/ListDistributedGrantsCommand" ; import { ListFailuresForLicenseConfigurationOperationsCommandInput , ListFailuresForLicenseConfigurationOperationsCommandOutput , } from "../commands/ListFailuresForLicenseConfigurationOperationsCommand" ; import { ListLicenseConfigurationsCommandInput , ListLicenseConfigurationsCommandOutput , } from "../commands/ListLicenseConfigurationsCommand" ; import { ListLicenseConversionTasksCommandInput , ListLicenseConversionTasksCommandOutput , } from "../commands/ListLicenseConversionTasksCommand" ; import { ListLicenseManagerReportGeneratorsCommandInput , ListLicenseManagerReportGeneratorsCommandOutput , } from "../commands/ListLicenseManagerReportGeneratorsCommand" ; import { ListLicensesCommandInput , ListLicensesCommandOutput } from "../commands/ListLicensesCommand" ; import { ListLicenseSpecificationsForResourceCommandInput , ListLicenseSpecificationsForResourceCommandOutput , } from "../commands/ListLicenseSpecificationsForResourceCommand" ; import { ListLicenseVersionsCommandInput , ListLicenseVersionsCommandOutput , } from "../commands/ListLicenseVersionsCommand" ; import { ListReceivedGrantsCommandInput , ListReceivedGrantsCommandOutput } from "../commands/ListReceivedGrantsCommand" ; import { ListReceivedLicensesCommandInput , ListReceivedLicensesCommandOutput , } from "../commands/ListReceivedLicensesCommand" ; import { ListResourceInventoryCommandInput , ListResourceInventoryCommandOutput , } from "../commands/ListResourceInventoryCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { ListTokensCommandInput , ListTokensCommandOutput } from "../commands/ListTokensCommand" ; import { ListUsageForLicenseConfigurationCommandInput , ListUsageForLicenseConfigurationCommandOutput , } from "../commands/ListUsageForLicenseConfigurationCommand" ; import { RejectGrantCommandInput , RejectGrantCommandOutput } from "../commands/RejectGrantCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateLicenseConfigurationCommandInput , UpdateLicenseConfigurationCommandOutput , } from "../commands/UpdateLicenseConfigurationCommand" ; import { UpdateLicenseManagerReportGeneratorCommandInput , UpdateLicenseManagerReportGeneratorCommandOutput , } from "../commands/UpdateLicenseManagerReportGeneratorCommand" ; import { UpdateLicenseSpecificationsForResourceCommandInput , UpdateLicenseSpecificationsForResourceCommandOutput , } from "../commands/UpdateLicenseSpecificationsForResourceCommand" ; import { UpdateServiceSettingsCommandInput , UpdateServiceSettingsCommandOutput , } from "../commands/UpdateServiceSettingsCommand" ; import { AcceptGrantRequest , AcceptGrantResponse , AccessDeniedException , AllowedOperation , AuthorizationException , AutomatedDiscoveryInformation , BorrowConfiguration , CheckInLicenseRequest , CheckInLicenseResponse , CheckoutBorrowLicenseRequest , CheckoutBorrowLicenseResponse , CheckoutLicenseRequest , CheckoutLicenseResponse , ConflictException , ConsumedLicenseSummary , ConsumptionConfiguration , CreateGrantRequest , CreateGrantResponse , CreateGrantVersionRequest , CreateGrantVersionResponse , CreateLicenseConfigurationRequest , CreateLicenseConfigurationResponse , CreateLicenseConversionTaskForResourceRequest , CreateLicenseConversionTaskForResourceResponse , CreateLicenseManagerReportGeneratorRequest , CreateLicenseManagerReportGeneratorResponse , CreateLicenseRequest , CreateLicenseResponse , CreateLicenseVersionRequest , CreateLicenseVersionResponse , CreateTokenRequest , CreateTokenResponse , DatetimeRange , DeleteGrantRequest , DeleteGrantResponse , DeleteLicenseConfigurationRequest , DeleteLicenseConfigurationResponse , DeleteLicenseManagerReportGeneratorRequest , DeleteLicenseManagerReportGeneratorResponse , DeleteLicenseRequest , DeleteLicenseResponse , DeleteTokenRequest , DeleteTokenResponse , Entitlement , EntitlementData , EntitlementNotAllowedException , EntitlementUsage , ExtendLicenseConsumptionRequest , ExtendLicenseConsumptionResponse , FailedDependencyException , Filter , FilterLimitExceededException , GetAccessTokenRequest , GetAccessTokenResponse , GetGrantRequest , GetGrantResponse , GetLicenseConfigurationRequest , GetLicenseConfigurationResponse , GetLicenseConversionTaskRequest , GetLicenseConversionTaskResponse , GetLicenseManagerReportGeneratorRequest , GetLicenseManagerReportGeneratorResponse , GetLicenseRequest , GetLicenseResponse , GetLicenseUsageRequest , GetLicenseUsageResponse , GetServiceSettingsRequest , GetServiceSettingsResponse , Grant , GrantedLicense , InvalidParameterValueException , InvalidResourceStateException , InventoryFilter , Issuer , IssuerDetails , License , LicenseConfiguration , LicenseConfigurationAssociation , LicenseConfigurationUsage , LicenseConversionContext , LicenseConversionTask , LicenseOperationFailure , LicenseSpecification , LicenseUsage , LicenseUsageException , ListAssociationsForLicenseConfigurationRequest , ListAssociationsForLicenseConfigurationResponse , ListDistributedGrantsRequest , ListDistributedGrantsResponse , ListFailuresForLicenseConfigurationOperationsRequest , ListFailuresForLicenseConfigurationOperationsResponse , ListLicenseConfigurationsRequest , ListLicenseConfigurationsResponse , ListLicenseConversionTasksRequest , ListLicenseConversionTasksResponse , ListLicenseManagerReportGeneratorsRequest , ListLicenseManagerReportGeneratorsResponse , ListLicenseSpecificationsForResourceRequest , ListLicenseSpecificationsForResourceResponse , ListLicensesRequest , ListLicensesResponse , ListLicenseVersionsRequest , ListLicenseVersionsResponse , ListReceivedGrantsRequest , ListReceivedGrantsResponse , ListReceivedLicensesRequest , ListReceivedLicensesResponse , ListResourceInventoryRequest , ListResourceInventoryResponse , ListTagsForResourceRequest , ListTagsForResourceResponse , ListTokensRequest , ListTokensResponse , ListUsageForLicenseConfigurationRequest , ListUsageForLicenseConfigurationResponse , ManagedResourceSummary , Metadata , NoEntitlementsAllowedException , OrganizationConfiguration , ProductInformation , ProductInformationFilter , ProvisionalConfiguration , RateLimitExceededException , ReceivedMetadata , RedirectException , RejectGrantRequest , RejectGrantResponse , ReportContext , ReportFrequency , ReportGenerator , ReportType , ResourceInventory , ResourceLimitExceededException , ResourceNotFoundException , S3Location , ServerInternalException , Tag , TagResourceRequest , TagResourceResponse , TokenData , UnsupportedDigitalSignatureMethodException , UntagResourceRequest , UntagResourceResponse , UpdateLicenseConfigurationRequest , UpdateLicenseConfigurationResponse , UpdateLicenseManagerReportGeneratorRequest , UpdateLicenseManagerReportGeneratorResponse , UpdateLicenseSpecificationsForResourceRequest , UpdateLicenseSpecificationsForResourceResponse , UpdateServiceSettingsRequest , UpdateServiceSettingsResponse , ValidationException , } from "../models/models_0" ; export const serializeAws_json1_1AcceptGrantCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.AcceptGrant" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AcceptGrantRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CheckInLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CheckInLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CheckInLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CheckoutBorrowLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CheckoutBorrowLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CheckoutBorrowLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CheckoutLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CheckoutLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CheckoutLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGrantCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateGrant" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGrantRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateGrantVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateGrantVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateGrantVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateLicenseConversionTaskForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateLicenseConversionTaskForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateLicenseConversionTaskForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateLicenseManagerReportGeneratorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateLicenseManagerReportGenerator" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateLicenseManagerReportGeneratorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateLicenseVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateLicenseVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateLicenseVersionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.CreateToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteGrantCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.DeleteGrant" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteGrantRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.DeleteLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.DeleteLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteLicenseManagerReportGeneratorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.DeleteLicenseManagerReportGenerator" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteLicenseManagerReportGeneratorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.DeleteToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ExtendLicenseConsumptionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ExtendLicenseConsumption" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ExtendLicenseConsumptionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetAccessTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetAccessToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetAccessTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetGrantCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetGrant" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetGrantRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLicenseCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetLicense" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLicenseRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLicenseConversionTaskCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetLicenseConversionTask" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLicenseConversionTaskRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLicenseManagerReportGeneratorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetLicenseManagerReportGenerator" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLicenseManagerReportGeneratorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLicenseUsageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetLicenseUsage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLicenseUsageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetServiceSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.GetServiceSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetServiceSettingsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAssociationsForLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListAssociationsForLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListDistributedGrantsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListDistributedGrants" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListDistributedGrantsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListFailuresForLicenseConfigurationOperations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicenseConfigurationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenseConfigurations" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicenseConfigurationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicenseConversionTasksCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenseConversionTasks" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicenseConversionTasksRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicenseManagerReportGeneratorsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenseManagerReportGenerators" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicenseManagerReportGeneratorsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicensesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenses" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicensesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicenseSpecificationsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenseSpecificationsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicenseSpecificationsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListLicenseVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListLicenseVersions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListLicenseVersionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListReceivedGrantsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListReceivedGrants" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListReceivedGrantsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListReceivedLicensesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListReceivedLicenses" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListReceivedLicensesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListResourceInventoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListResourceInventory" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListResourceInventoryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListTokensCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListTokens" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTokensRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListUsageForLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.ListUsageForLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListUsageForLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RejectGrantCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.RejectGrant" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RejectGrantRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateLicenseConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.UpdateLicenseConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateLicenseConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateLicenseManagerReportGeneratorCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.UpdateLicenseManagerReportGenerator" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateLicenseManagerReportGeneratorRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateLicenseSpecificationsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.UpdateLicenseSpecificationsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateLicenseSpecificationsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateServiceSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AWSLicenseManager.UpdateServiceSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateServiceSettingsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AcceptGrantCommand = async ( output , context ) : Promise < AcceptGrantCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AcceptGrantCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AcceptGrantResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AcceptGrantCommandError = async ( output , context ) : Promise < AcceptGrantCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CheckInLicenseCommand = async ( output , context ) : Promise < CheckInLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CheckInLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CheckInLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CheckInLicenseCommandError = async ( output , context ) : Promise < CheckInLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.licensemanager#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CheckoutBorrowLicenseCommand = async ( output , context ) : Promise < CheckoutBorrowLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CheckoutBorrowLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CheckoutBorrowLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CheckoutBorrowLicenseCommandError = async ( output , context ) : Promise < CheckoutBorrowLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "EntitlementNotAllowedException" : case "com.amazonaws.licensemanager#EntitlementNotAllowedException" : response = { ... ( await deserializeAws_json1_1EntitlementNotAllowedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoEntitlementsAllowedException" : case "com.amazonaws.licensemanager#NoEntitlementsAllowedException" : response = { ... ( await deserializeAws_json1_1NoEntitlementsAllowedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedDigitalSignatureMethodException" : case "com.amazonaws.licensemanager#UnsupportedDigitalSignatureMethodException" : response = { ... ( await deserializeAws_json1_1UnsupportedDigitalSignatureMethodExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CheckoutLicenseCommand = async ( output , context ) : Promise < CheckoutLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CheckoutLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CheckoutLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CheckoutLicenseCommandError = async ( output , context ) : Promise < CheckoutLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "NoEntitlementsAllowedException" : case "com.amazonaws.licensemanager#NoEntitlementsAllowedException" : response = { ... ( await deserializeAws_json1_1NoEntitlementsAllowedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedDigitalSignatureMethodException" : case "com.amazonaws.licensemanager#UnsupportedDigitalSignatureMethodException" : response = { ... ( await deserializeAws_json1_1UnsupportedDigitalSignatureMethodExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateGrantCommand = async ( output , context ) : Promise < CreateGrantCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGrantCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGrantResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGrantCommandError = async ( output , context ) : Promise < CreateGrantCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateGrantVersionCommand = async ( output , context ) : Promise < CreateGrantVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateGrantVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateGrantVersionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateGrantVersionCommandError = async ( output , context ) : Promise < CreateGrantVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateLicenseCommand = async ( output , context ) : Promise < CreateLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateLicenseCommandError = async ( output , context ) : Promise < CreateLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateLicenseConfigurationCommand = async ( output , context ) : Promise < CreateLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateLicenseConfigurationCommandError = async ( output , context ) : Promise < CreateLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1CreateLicenseConversionTaskForResourceCommand = async ( output , context ) : Promise < CreateLicenseConversionTaskForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateLicenseConversionTaskForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateLicenseConversionTaskForResourceCommandError = async ( output , context ) : Promise < CreateLicenseConversionTaskForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommand = async ( output , context ) : Promise < CreateLicenseManagerReportGeneratorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateLicenseManagerReportGeneratorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateLicenseManagerReportGeneratorCommandError = async ( output , context ) : Promise < CreateLicenseManagerReportGeneratorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateLicenseVersionCommand = async ( output , context ) : Promise < CreateLicenseVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateLicenseVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateLicenseVersionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateLicenseVersionCommandError = async ( output , context ) : Promise < CreateLicenseVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.licensemanager#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateTokenCommand = async ( output , context ) : Promise < CreateTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateTokenCommandError = async ( output , context ) : Promise < CreateTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteGrantCommand = async ( output , context ) : Promise < DeleteGrantCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteGrantCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteGrantResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteGrantCommandError = async ( output , context ) : Promise < DeleteGrantCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteLicenseCommand = async ( output , context ) : Promise < DeleteLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteLicenseCommandError = async ( output , context ) : Promise < DeleteLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.licensemanager#ConflictException" : response = { ... ( await deserializeAws_json1_1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteLicenseConfigurationCommand = async ( output , context ) : Promise < DeleteLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteLicenseConfigurationCommandError = async ( output , context ) : Promise < DeleteLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1DeleteLicenseManagerReportGeneratorCommand = async ( output , context ) : Promise < DeleteLicenseManagerReportGeneratorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteLicenseManagerReportGeneratorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteLicenseManagerReportGeneratorCommandError = async ( output , context ) : Promise < DeleteLicenseManagerReportGeneratorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteTokenCommand = async ( output , context ) : Promise < DeleteTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteTokenCommandError = async ( output , context ) : Promise < DeleteTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RedirectException" : case "com.amazonaws.licensemanager#RedirectException" : response = { ... ( await deserializeAws_json1_1RedirectExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ExtendLicenseConsumptionCommand = async ( output , context ) : Promise < ExtendLicenseConsumptionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ExtendLicenseConsumptionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ExtendLicenseConsumptionResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ExtendLicenseConsumptionCommandError = async ( output , context ) : Promise < ExtendLicenseConsumptionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetAccessTokenCommand = async ( output , context ) : Promise < GetAccessTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetAccessTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetAccessTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetAccessTokenCommandError = async ( output , context ) : Promise < GetAccessTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetGrantCommand = async ( output , context ) : Promise < GetGrantCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetGrantCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetGrantResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetGrantCommandError = async ( output , context ) : Promise < GetGrantCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetLicenseCommand = async ( output , context ) : Promise < GetLicenseCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLicenseCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLicenseResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLicenseCommandError = async ( output , context ) : Promise < GetLicenseCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetLicenseConfigurationCommand = async ( output , context ) : Promise < GetLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLicenseConfigurationCommandError = async ( output , context ) : Promise < GetLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetLicenseConversionTaskCommand = async ( output , context ) : Promise < GetLicenseConversionTaskCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLicenseConversionTaskCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLicenseConversionTaskResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLicenseConversionTaskCommandError = async ( output , context ) : Promise < GetLicenseConversionTaskCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1GetLicenseManagerReportGeneratorCommand = async ( output , context ) : Promise < GetLicenseManagerReportGeneratorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLicenseManagerReportGeneratorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLicenseManagerReportGeneratorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLicenseManagerReportGeneratorCommandError = async ( output , context ) : Promise < GetLicenseManagerReportGeneratorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetLicenseUsageCommand = async ( output , context ) : Promise < GetLicenseUsageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLicenseUsageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLicenseUsageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLicenseUsageCommandError = async ( output , context ) : Promise < GetLicenseUsageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetServiceSettingsCommand = async ( output , context ) : Promise < GetServiceSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetServiceSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetServiceSettingsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetServiceSettingsCommandError = async ( output , context ) : Promise < GetServiceSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListAssociationsForLicenseConfigurationCommand = async ( output , context ) : Promise < ListAssociationsForLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAssociationsForLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAssociationsForLicenseConfigurationCommandError = async ( output , context ) : Promise < ListAssociationsForLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FilterLimitExceededException" : case "com.amazonaws.licensemanager#FilterLimitExceededException" : response = { ... ( await deserializeAws_json1_1FilterLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListDistributedGrantsCommand = async ( output , context ) : Promise < ListDistributedGrantsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListDistributedGrantsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListDistributedGrantsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListDistributedGrantsCommandError = async ( output , context ) : Promise < ListDistributedGrantsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommand = async ( output , context ) : Promise < ListFailuresForLicenseConfigurationOperationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsCommandError = async ( output , context ) : Promise < ListFailuresForLicenseConfigurationOperationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListLicenseConfigurationsCommand = async ( output , context ) : Promise < ListLicenseConfigurationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicenseConfigurationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicenseConfigurationsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicenseConfigurationsCommandError = async ( output , context ) : Promise < ListLicenseConfigurationsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FilterLimitExceededException" : case "com.amazonaws.licensemanager#FilterLimitExceededException" : response = { ... ( await deserializeAws_json1_1FilterLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListLicenseConversionTasksCommand = async ( output , context ) : Promise < ListLicenseConversionTasksCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicenseConversionTasksCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicenseConversionTasksResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicenseConversionTasksCommandError = async ( output , context ) : Promise < ListLicenseConversionTasksCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListLicenseManagerReportGeneratorsCommand = async ( output , context ) : Promise < ListLicenseManagerReportGeneratorsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicenseManagerReportGeneratorsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicenseManagerReportGeneratorsCommandError = async ( output , context ) : Promise < ListLicenseManagerReportGeneratorsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListLicensesCommand = async ( output , context ) : Promise < ListLicensesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicensesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicensesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicensesCommandError = async ( output , context ) : Promise < ListLicensesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListLicenseSpecificationsForResourceCommand = async ( output , context ) : Promise < ListLicenseSpecificationsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicenseSpecificationsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicenseSpecificationsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicenseSpecificationsForResourceCommandError = async ( output , context ) : Promise < ListLicenseSpecificationsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListLicenseVersionsCommand = async ( output , context ) : Promise < ListLicenseVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListLicenseVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListLicenseVersionsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListLicenseVersionsCommandError = async ( output , context ) : Promise < ListLicenseVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListReceivedGrantsCommand = async ( output , context ) : Promise < ListReceivedGrantsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListReceivedGrantsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListReceivedGrantsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListReceivedGrantsCommandError = async ( output , context ) : Promise < ListReceivedGrantsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListReceivedLicensesCommand = async ( output , context ) : Promise < ListReceivedLicensesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListReceivedLicensesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListReceivedLicensesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListReceivedLicensesCommandError = async ( output , context ) : Promise < ListReceivedLicensesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListResourceInventoryCommand = async ( output , context ) : Promise < ListResourceInventoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListResourceInventoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListResourceInventoryResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListResourceInventoryCommandError = async ( output , context ) : Promise < ListResourceInventoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FailedDependencyException" : case "com.amazonaws.licensemanager#FailedDependencyException" : response = { ... ( await deserializeAws_json1_1FailedDependencyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FilterLimitExceededException" : case "com.amazonaws.licensemanager#FilterLimitExceededException" : response = { ... ( await deserializeAws_json1_1FilterLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTagsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1ListTokensCommand = async ( output , context ) : Promise < ListTokensCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListTokensCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListTokensResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListTokensCommandError = async ( output , context ) : Promise < ListTokensCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListUsageForLicenseConfigurationCommand = async ( output , context ) : Promise < ListUsageForLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListUsageForLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListUsageForLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListUsageForLicenseConfigurationCommandError = async ( output , context ) : Promise < ListUsageForLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "FilterLimitExceededException" : case "com.amazonaws.licensemanager#FilterLimitExceededException" : response = { ... ( await deserializeAws_json1_1FilterLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1RejectGrantCommand = async ( output , context ) : Promise < RejectGrantCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RejectGrantCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RejectGrantResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RejectGrantCommandError = async ( output , context ) : Promise < RejectGrantCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UntagResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateLicenseConfigurationCommand = async ( output , context ) : Promise < UpdateLicenseConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateLicenseConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateLicenseConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateLicenseConfigurationCommandError = async ( output , context ) : Promise < UpdateLicenseConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateLicenseManagerReportGeneratorCommand = async ( output , context ) : Promise < UpdateLicenseManagerReportGeneratorCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateLicenseManagerReportGeneratorCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateLicenseManagerReportGeneratorResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateLicenseManagerReportGeneratorCommandError = async ( output , context ) : Promise < UpdateLicenseManagerReportGeneratorCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.licensemanager#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.licensemanager#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.licensemanager#ValidationException" : response = { ... ( await deserializeAws_json1_1ValidationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommand = async ( output , context ) : Promise < UpdateLicenseSpecificationsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateLicenseSpecificationsForResourceResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateLicenseSpecificationsForResourceCommandError = async ( output , context ) : Promise < UpdateLicenseSpecificationsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.licensemanager#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LicenseUsageException" : case "com.amazonaws.licensemanager#LicenseUsageException" : response = { ... ( await deserializeAws_json1_1LicenseUsageExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const 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_1UpdateServiceSettingsCommand = async ( output , context ) : Promise < UpdateServiceSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateServiceSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateServiceSettingsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateServiceSettingsCommandError = async ( output , context ) : Promise < UpdateServiceSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.licensemanager#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "AuthorizationException" : case "com.amazonaws.licensemanager#AuthorizationException" : response = { ... ( await deserializeAws_json1_1AuthorizationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.licensemanager#InvalidParameterValueException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RateLimitExceededException" : case "com.amazonaws.licensemanager#RateLimitExceededException" : response = { ... ( await deserializeAws_json1_1RateLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerInternalException" : case "com.amazonaws.licensemanager#ServerInternalException" : response = { ... ( await deserializeAws_json1_1ServerInternalExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_1AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AccessDeniedException ( body , context ) ; const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1AuthorizationExceptionResponse = async ( parsedOutput , context ) : Promise < AuthorizationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AuthorizationException ( body , context ) ; const contents = { name : "AuthorizationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ConflictException ( body , context ) ; const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1EntitlementNotAllowedExceptionResponse = async ( parsedOutput , context ) : Promise < EntitlementNotAllowedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1EntitlementNotAllowedException ( body , context ) ; const contents = { name : "EntitlementNotAllowedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1FailedDependencyExceptionResponse = async ( parsedOutput , context ) : Promise < FailedDependencyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1FailedDependencyException ( body , context ) ; const contents = { name : "FailedDependencyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1FilterLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < FilterLimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1FilterLimitExceededException ( body , context ) ; const contents = { name : "FilterLimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterValueExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterValueException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterValueException ( body , context ) ; const contents = { name : "InvalidParameterValueException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidResourceStateExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidResourceStateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidResourceStateException ( body , context ) ; const contents = { name : "InvalidResourceStateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LicenseUsageExceptionResponse = async ( parsedOutput , context ) : Promise < LicenseUsageException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LicenseUsageException ( body , context ) ; const contents = { name : "LicenseUsageException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1NoEntitlementsAllowedExceptionResponse = async ( parsedOutput , context ) : Promise < NoEntitlementsAllowedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1NoEntitlementsAllowedException ( body , context ) ; const contents = { name : "NoEntitlementsAllowedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RateLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < RateLimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RateLimitExceededException ( body , context ) ; const contents = { name : "RateLimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RedirectExceptionResponse = async ( parsedOutput , context ) : Promise < RedirectException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RedirectException ( body , context ) ; const contents = { name : "RedirectException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceLimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceLimitExceededException ( body , context ) ; const contents = { name : "ResourceLimitExceededException" , $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_1ServerInternalExceptionResponse = async ( parsedOutput , context ) : Promise < ServerInternalException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ServerInternalException ( body , context ) ; const contents = { name : "ServerInternalException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedDigitalSignatureMethodExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedDigitalSignatureMethodException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedDigitalSignatureMethodException ( body , context ) ; const contents = { name : "UnsupportedDigitalSignatureMethodException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ValidationExceptionResponse = async ( parsedOutput , context ) : Promise < ValidationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ValidationException ( body , context ) ; const contents = { name : "ValidationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1AcceptGrantRequest = ( input , context ) : any => { return { ... ( input . GrantArn !== undefined && input . GrantArn !== null && { GrantArn : input . GrantArn } ) , } ; } ; const serializeAws_json1_1AllowedOperationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1BorrowConfiguration = ( input , context ) : any => { return { ... ( input . AllowEarlyCheckIn !== undefined && input . AllowEarlyCheckIn !== null && { AllowEarlyCheckIn : input . AllowEarlyCheckIn } ) , ... ( input . MaxTimeToLiveInMinutes !== undefined && input . MaxTimeToLiveInMinutes !== null && { MaxTimeToLiveInMinutes : input . MaxTimeToLiveInMinutes } ) , } ; } ; const serializeAws_json1_1CheckInLicenseRequest = ( input , context ) : any => { return { ... ( input . Beneficiary !== undefined && input . Beneficiary !== null && { Beneficiary : input . Beneficiary } ) , ... ( input . LicenseConsumptionToken !== undefined && input . LicenseConsumptionToken !== null && { LicenseConsumptionToken : input . LicenseConsumptionToken } ) , } ; } ; const serializeAws_json1_1CheckoutBorrowLicenseRequest = ( input , context ) : any => { return { ... ( input . CheckoutMetadata !== undefined && input . CheckoutMetadata !== null && { CheckoutMetadata : serializeAws_json1_1MetadataList ( input . CheckoutMetadata , context ) , } ) , ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . DigitalSignatureMethod !== undefined && input . DigitalSignatureMethod !== null && { DigitalSignatureMethod : input . DigitalSignatureMethod } ) , ... ( input . Entitlements !== undefined && input . Entitlements !== null && { Entitlements : serializeAws_json1_1EntitlementDataList ( input . Entitlements , context ) , } ) , ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . NodeId !== undefined && input . NodeId !== null && { NodeId : input . NodeId } ) , } ; } ; const serializeAws_json1_1CheckoutLicenseRequest = ( input , context ) : any => { return { ... ( input . Beneficiary !== undefined && input . Beneficiary !== null && { Beneficiary : input . Beneficiary } ) , ... ( input . CheckoutType !== undefined && input . CheckoutType !== null && { CheckoutType : input . CheckoutType } ) , ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . Entitlements !== undefined && input . Entitlements !== null && { Entitlements : serializeAws_json1_1EntitlementDataList ( input . Entitlements , context ) , } ) , ... ( input . KeyFingerprint !== undefined && input . KeyFingerprint !== null && { KeyFingerprint : input . KeyFingerprint } ) , ... ( input . NodeId !== undefined && input . NodeId !== null && { NodeId : input . NodeId } ) , ... ( input . ProductSKU !== undefined && input . ProductSKU !== null && { ProductSKU : input . ProductSKU } ) , } ; } ; const serializeAws_json1_1ConsumptionConfiguration = ( input , context ) : any => { return { ... ( input . BorrowConfiguration !== undefined && input . BorrowConfiguration !== null && { BorrowConfiguration : serializeAws_json1_1BorrowConfiguration ( input . BorrowConfiguration , context ) , } ) , ... ( input . ProvisionalConfiguration !== undefined && input . ProvisionalConfiguration !== null && { ProvisionalConfiguration : serializeAws_json1_1ProvisionalConfiguration ( input . ProvisionalConfiguration , context ) , } ) , ... ( input . RenewType !== undefined && input . RenewType !== null && { RenewType : input . RenewType } ) , } ; } ; const serializeAws_json1_1CreateGrantRequest = ( input , context ) : any => { return { ... ( input . AllowedOperations !== undefined && input . AllowedOperations !== null && { AllowedOperations : serializeAws_json1_1AllowedOperationList ( input . AllowedOperations , context ) , } ) , ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . GrantName !== undefined && input . GrantName !== null && { GrantName : input . GrantName } ) , ... ( input . HomeRegion !== undefined && input . HomeRegion !== null && { HomeRegion : input . HomeRegion } ) , ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . Principals !== undefined && input . Principals !== null && { Principals : serializeAws_json1_1PrincipalArnList ( input . Principals , context ) } ) , } ; } ; const serializeAws_json1_1CreateGrantVersionRequest = ( input , context ) : any => { return { ... ( input . AllowedOperations !== undefined && input . AllowedOperations !== null && { AllowedOperations : serializeAws_json1_1AllowedOperationList ( input . AllowedOperations , context ) , } ) , ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . GrantArn !== undefined && input . GrantArn !== null && { GrantArn : input . GrantArn } ) , ... ( input . GrantName !== undefined && input . GrantName !== null && { GrantName : input . GrantName } ) , ... ( input . SourceVersion !== undefined && input . SourceVersion !== null && { SourceVersion : input . SourceVersion } ) , ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , ... ( input . StatusReason !== undefined && input . StatusReason !== null && { StatusReason : input . StatusReason } ) , } ; } ; const serializeAws_json1_1CreateLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DisassociateWhenNotFound !== undefined && input . DisassociateWhenNotFound !== null && { DisassociateWhenNotFound : input . DisassociateWhenNotFound } ) , ... ( input . LicenseCount !== undefined && input . LicenseCount !== null && { LicenseCount : input . LicenseCount } ) , ... ( input . LicenseCountHardLimit !== undefined && input . LicenseCountHardLimit !== null && { LicenseCountHardLimit : input . LicenseCountHardLimit } ) , ... ( input . LicenseCountingType !== undefined && input . LicenseCountingType !== null && { LicenseCountingType : input . LicenseCountingType } ) , ... ( input . LicenseRules !== undefined && input . LicenseRules !== null && { LicenseRules : serializeAws_json1_1StringList ( input . LicenseRules , context ) } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . ProductInformationList !== undefined && input . ProductInformationList !== null && { ProductInformationList : serializeAws_json1_1ProductInformationList ( input . ProductInformationList , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateLicenseConversionTaskForResourceRequest = ( input , context ) : any => { return { ... ( input . DestinationLicenseContext !== undefined && input . DestinationLicenseContext !== null && { DestinationLicenseContext : serializeAws_json1_1LicenseConversionContext ( input . DestinationLicenseContext , context ) , } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . SourceLicenseContext !== undefined && input . SourceLicenseContext !== null && { SourceLicenseContext : serializeAws_json1_1LicenseConversionContext ( input . SourceLicenseContext , context ) , } ) , } ; } ; const serializeAws_json1_1CreateLicenseManagerReportGeneratorRequest = ( input , context ) : any => { return { ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . ReportContext !== undefined && input . ReportContext !== null && { ReportContext : serializeAws_json1_1ReportContext ( input . ReportContext , context ) , } ) , ... ( input . ReportFrequency !== undefined && input . ReportFrequency !== null && { ReportFrequency : serializeAws_json1_1ReportFrequency ( input . ReportFrequency , context ) , } ) , ... ( input . ReportGeneratorName !== undefined && input . ReportGeneratorName !== null && { ReportGeneratorName : input . ReportGeneratorName } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : serializeAws_json1_1ReportTypeList ( input . Type , context ) } ) , } ; } ; const serializeAws_json1_1CreateLicenseRequest = ( input , context ) : any => { return { ... ( input . Beneficiary !== undefined && input . Beneficiary !== null && { Beneficiary : input . Beneficiary } ) , ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . ConsumptionConfiguration !== undefined && input . ConsumptionConfiguration !== null && { ConsumptionConfiguration : serializeAws_json1_1ConsumptionConfiguration ( input . ConsumptionConfiguration , context ) , } ) , ... ( input . Entitlements !== undefined && input . Entitlements !== null && { Entitlements : serializeAws_json1_1EntitlementList ( input . Entitlements , context ) , } ) , ... ( input . HomeRegion !== undefined && input . HomeRegion !== null && { HomeRegion : input . HomeRegion } ) , ... ( input . Issuer !== undefined && input . Issuer !== null && { Issuer : serializeAws_json1_1Issuer ( input . Issuer , context ) } ) , ... ( input . LicenseMetadata !== undefined && input . LicenseMetadata !== null && { LicenseMetadata : serializeAws_json1_1MetadataList ( input . LicenseMetadata , context ) , } ) , ... ( input . LicenseName !== undefined && input . LicenseName !== null && { LicenseName : input . LicenseName } ) , ... ( input . ProductName !== undefined && input . ProductName !== null && { ProductName : input . ProductName } ) , ... ( input . ProductSKU !== undefined && input . ProductSKU !== null && { ProductSKU : input . ProductSKU } ) , ... ( input . Validity !== undefined && input . Validity !== null && { Validity : serializeAws_json1_1DatetimeRange ( input . Validity , context ) } ) , } ; } ; const serializeAws_json1_1CreateLicenseVersionRequest = ( input , context ) : any => { return { ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . ConsumptionConfiguration !== undefined && input . ConsumptionConfiguration !== null && { ConsumptionConfiguration : serializeAws_json1_1ConsumptionConfiguration ( input . ConsumptionConfiguration , context ) , } ) , ... ( input . Entitlements !== undefined && input . Entitlements !== null && { Entitlements : serializeAws_json1_1EntitlementList ( input . Entitlements , context ) , } ) , ... ( input . HomeRegion !== undefined && input . HomeRegion !== null && { HomeRegion : input . HomeRegion } ) , ... ( input . Issuer !== undefined && input . Issuer !== null && { Issuer : serializeAws_json1_1Issuer ( input . Issuer , context ) } ) , ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . LicenseMetadata !== undefined && input . LicenseMetadata !== null && { LicenseMetadata : serializeAws_json1_1MetadataList ( input . LicenseMetadata , context ) , } ) , ... ( input . LicenseName !== undefined && input . LicenseName !== null && { LicenseName : input . LicenseName } ) , ... ( input . ProductName !== undefined && input . ProductName !== null && { ProductName : input . ProductName } ) , ... ( input . SourceVersion !== undefined && input . SourceVersion !== null && { SourceVersion : input . SourceVersion } ) , ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , ... ( input . Validity !== undefined && input . Validity !== null && { Validity : serializeAws_json1_1DatetimeRange ( input . Validity , context ) } ) , } ; } ; const serializeAws_json1_1CreateTokenRequest = ( input , context ) : any => { return { ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . ExpirationInDays !== undefined && input . ExpirationInDays !== null && { ExpirationInDays : input . ExpirationInDays } ) , ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . RoleArns !== undefined && input . RoleArns !== null && { RoleArns : serializeAws_json1_1ArnList ( input . RoleArns , context ) } ) , ... ( input . TokenProperties !== undefined && input . TokenProperties !== null && { TokenProperties : serializeAws_json1_1MaxSize3StringList ( input . TokenProperties , context ) , } ) , } ; } ; const serializeAws_json1_1DatetimeRange = ( input , context ) : any => { return { ... ( input . Begin !== undefined && input . Begin !== null && { Begin : input . Begin } ) , ... ( input . End !== undefined && input . End !== null && { End : input . End } ) , } ; } ; const serializeAws_json1_1DeleteGrantRequest = ( input , context ) : any => { return { ... ( input . GrantArn !== undefined && input . GrantArn !== null && { GrantArn : input . GrantArn } ) , ... ( input . StatusReason !== undefined && input . StatusReason !== null && { StatusReason : input . StatusReason } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1DeleteLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , } ; } ; const serializeAws_json1_1DeleteLicenseManagerReportGeneratorRequest = ( input , context ) : any => { return { ... ( input . LicenseManagerReportGeneratorArn !== undefined && input . LicenseManagerReportGeneratorArn !== null && { LicenseManagerReportGeneratorArn : input . LicenseManagerReportGeneratorArn , } ) , } ; } ; const serializeAws_json1_1DeleteLicenseRequest = ( input , context ) : any => { return { ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . SourceVersion !== undefined && input . SourceVersion !== null && { SourceVersion : input . SourceVersion } ) , } ; } ; const serializeAws_json1_1DeleteTokenRequest = ( input , context ) : any => { return { ... ( input . TokenId !== undefined && input . TokenId !== null && { TokenId : input . TokenId } ) , } ; } ; const serializeAws_json1_1Entitlement = ( input , context ) : any => { return { ... ( input . AllowCheckIn !== undefined && input . AllowCheckIn !== null && { AllowCheckIn : input . AllowCheckIn } ) , ... ( input . MaxCount !== undefined && input . MaxCount !== null && { MaxCount : input . MaxCount } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Overage !== undefined && input . Overage !== null && { Overage : input . Overage } ) , ... ( input . Unit !== undefined && input . Unit !== null && { Unit : input . Unit } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1EntitlementData = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Unit !== undefined && input . Unit !== null && { Unit : input . Unit } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1EntitlementDataList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1EntitlementData ( entry , context ) ; } ) ; } ; const serializeAws_json1_1EntitlementList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Entitlement ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ExtendLicenseConsumptionRequest = ( input , context ) : any => { return { ... ( input . DryRun !== undefined && input . DryRun !== null && { DryRun : input . DryRun } ) , ... ( input . LicenseConsumptionToken !== undefined && input . LicenseConsumptionToken !== null && { LicenseConsumptionToken : input . LicenseConsumptionToken } ) , } ; } ; const serializeAws_json1_1Filter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_json1_1FilterValues ( input . Values , context ) } ) , } ; } ; const serializeAws_json1_1FilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Filter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1Filters = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Filter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1FilterValues = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GetAccessTokenRequest = ( input , context ) : any => { return { ... ( input . Token !== undefined && input . Token !== null && { Token : input . Token } ) , ... ( input . TokenProperties !== undefined && input . TokenProperties !== null && { TokenProperties : serializeAws_json1_1MaxSize3StringList ( input . TokenProperties , context ) , } ) , } ; } ; const serializeAws_json1_1GetGrantRequest = ( input , context ) : any => { return { ... ( input . GrantArn !== undefined && input . GrantArn !== null && { GrantArn : input . GrantArn } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1GetLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , } ; } ; const serializeAws_json1_1GetLicenseConversionTaskRequest = ( input , context ) : any => { return { ... ( input . LicenseConversionTaskId !== undefined && input . LicenseConversionTaskId !== null && { LicenseConversionTaskId : input . LicenseConversionTaskId } ) , } ; } ; const serializeAws_json1_1GetLicenseManagerReportGeneratorRequest = ( input , context ) : any => { return { ... ( input . LicenseManagerReportGeneratorArn !== undefined && input . LicenseManagerReportGeneratorArn !== null && { LicenseManagerReportGeneratorArn : input . LicenseManagerReportGeneratorArn , } ) , } ; } ; const serializeAws_json1_1GetLicenseRequest = ( input , context ) : any => { return { ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . Version !== undefined && input . Version !== null && { Version : input . Version } ) , } ; } ; const serializeAws_json1_1GetLicenseUsageRequest = ( input , context ) : any => { return { ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , } ; } ; const serializeAws_json1_1GetServiceSettingsRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1InventoryFilter = ( input , context ) : any => { return { ... ( input . Condition !== undefined && input . Condition !== null && { Condition : input . Condition } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1InventoryFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1InventoryFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1Issuer = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SignKey !== undefined && input . SignKey !== null && { SignKey : input . SignKey } ) , } ; } ; const serializeAws_json1_1LicenseConversionContext = ( input , context ) : any => { return { ... ( input . UsageOperation !== undefined && input . UsageOperation !== null && { UsageOperation : input . UsageOperation } ) , } ; } ; const serializeAws_json1_1LicenseSpecification = ( input , context ) : any => { return { ... ( input . AmiAssociationScope !== undefined && input . AmiAssociationScope !== null && { AmiAssociationScope : input . AmiAssociationScope } ) , ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , } ; } ; const serializeAws_json1_1LicenseSpecifications = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1LicenseSpecification ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ListAssociationsForLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListDistributedGrantsRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . GrantArns !== undefined && input . GrantArns !== null && { GrantArns : serializeAws_json1_1ArnList ( input . GrantArns , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListFailuresForLicenseConfigurationOperationsRequest = ( input , context ) : any => { return { ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListLicenseConfigurationsRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1Filters ( input . Filters , context ) } ) , ... ( input . LicenseConfigurationArns !== undefined && input . LicenseConfigurationArns !== null && { LicenseConfigurationArns : serializeAws_json1_1StringList ( input . LicenseConfigurationArns , context ) , } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListLicenseConversionTasksRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1Filters ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListLicenseManagerReportGeneratorsRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListLicenseSpecificationsForResourceRequest = ( input , context ) : any => { return { ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_1ListLicensesRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . LicenseArns !== undefined && input . LicenseArns !== null && { LicenseArns : serializeAws_json1_1ArnList ( input . LicenseArns , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListLicenseVersionsRequest = ( input , context ) : any => { return { ... ( input . LicenseArn !== undefined && input . LicenseArn !== null && { LicenseArn : input . LicenseArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListReceivedGrantsRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . GrantArns !== undefined && input . GrantArns !== null && { GrantArns : serializeAws_json1_1ArnList ( input . GrantArns , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListReceivedLicensesRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . LicenseArns !== undefined && input . LicenseArns !== null && { LicenseArns : serializeAws_json1_1ArnList ( input . LicenseArns , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListResourceInventoryRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1InventoryFilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_1ListTokensRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1FilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . TokenIds !== undefined && input . TokenIds !== null && { TokenIds : serializeAws_json1_1StringList ( input . TokenIds , context ) } ) , } ; } ; const serializeAws_json1_1ListUsageForLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_json1_1Filters ( input . Filters , context ) } ) , ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1MaxSize3StringList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1Metadata = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1MetadataList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Metadata ( entry , context ) ; } ) ; } ; const serializeAws_json1_1OrganizationConfiguration = ( input , context ) : any => { return { ... ( input . EnableIntegration !== undefined && input . EnableIntegration !== null && { EnableIntegration : input . EnableIntegration } ) , } ; } ; const serializeAws_json1_1PrincipalArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ProductInformation = ( input , context ) : any => { return { ... ( input . ProductInformationFilterList !== undefined && input . ProductInformationFilterList !== null && { ProductInformationFilterList : serializeAws_json1_1ProductInformationFilterList ( input . ProductInformationFilterList , context ) , } ) , ... ( input . ResourceType !== undefined && input . ResourceType !== null && { ResourceType : input . ResourceType } ) , } ; } ; const serializeAws_json1_1ProductInformationFilter = ( input , context ) : any => { return { ... ( input . ProductInformationFilterComparator !== undefined && input . ProductInformationFilterComparator !== null && { ProductInformationFilterComparator : input . ProductInformationFilterComparator , } ) , ... ( input . ProductInformationFilterName !== undefined && input . ProductInformationFilterName !== null && { ProductInformationFilterName : input . ProductInformationFilterName , } ) , ... ( input . ProductInformationFilterValue !== undefined && input . ProductInformationFilterValue !== null && { ProductInformationFilterValue : serializeAws_json1_1StringList ( input . ProductInformationFilterValue , context ) , } ) , } ; } ; const serializeAws_json1_1ProductInformationFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ProductInformationFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ProductInformationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ProductInformation ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ProvisionalConfiguration = ( input , context ) : any => { return { ... ( input . MaxTimeToLiveInMinutes !== undefined && input . MaxTimeToLiveInMinutes !== null && { MaxTimeToLiveInMinutes : input . MaxTimeToLiveInMinutes } ) , } ; } ; const serializeAws_json1_1RejectGrantRequest = ( input , context ) : any => { return { ... ( input . GrantArn !== undefined && input . GrantArn !== null && { GrantArn : input . GrantArn } ) , } ; } ; const serializeAws_json1_1ReportContext = ( input , context ) : any => { return { ... ( input . licenseConfigurationArns !== undefined && input . licenseConfigurationArns !== null && { licenseConfigurationArns : serializeAws_json1_1ArnList ( input . licenseConfigurationArns , context ) , } ) , } ; } ; const serializeAws_json1_1ReportFrequency = ( input , context ) : any => { return { ... ( input . period !== undefined && input . period !== null && { period : input . period } ) , ... ( input . value !== undefined && input . value !== null && { value : input . value } ) , } ; } ; const serializeAws_json1_1ReportTypeList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1StringList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1UntagResourceRequest = ( input , context ) : any => { return { ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_1TagKeyList ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_1UpdateLicenseConfigurationRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . DisassociateWhenNotFound !== undefined && input . DisassociateWhenNotFound !== null && { DisassociateWhenNotFound : input . DisassociateWhenNotFound } ) , ... ( input . LicenseConfigurationArn !== undefined && input . LicenseConfigurationArn !== null && { LicenseConfigurationArn : input . LicenseConfigurationArn } ) , ... ( input . LicenseConfigurationStatus !== undefined && input . LicenseConfigurationStatus !== null && { LicenseConfigurationStatus : input . LicenseConfigurationStatus } ) , ... ( input . LicenseCount !== undefined && input . LicenseCount !== null && { LicenseCount : input . LicenseCount } ) , ... ( input . LicenseCountHardLimit !== undefined && input . LicenseCountHardLimit !== null && { LicenseCountHardLimit : input . LicenseCountHardLimit } ) , ... ( input . LicenseRules !== undefined && input . LicenseRules !== null && { LicenseRules : serializeAws_json1_1StringList ( input . LicenseRules , context ) } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . ProductInformationList !== undefined && input . ProductInformationList !== null && { ProductInformationList : serializeAws_json1_1ProductInformationList ( input . ProductInformationList , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateLicenseManagerReportGeneratorRequest = ( input , context ) : any => { return { ... ( input . ClientToken !== undefined && input . ClientToken !== null && { ClientToken : input . ClientToken } ) , ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . LicenseManagerReportGeneratorArn !== undefined && input . LicenseManagerReportGeneratorArn !== null && { LicenseManagerReportGeneratorArn : input . LicenseManagerReportGeneratorArn , } ) , ... ( input . ReportContext !== undefined && input . ReportContext !== null && { ReportContext : serializeAws_json1_1ReportContext ( input . ReportContext , context ) , } ) , ... ( input . ReportFrequency !== undefined && input . ReportFrequency !== null && { ReportFrequency : serializeAws_json1_1ReportFrequency ( input . ReportFrequency , context ) , } ) , ... ( input . ReportGeneratorName !== undefined && input . ReportGeneratorName !== null && { ReportGeneratorName : input . ReportGeneratorName } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : serializeAws_json1_1ReportTypeList ( input . Type , context ) } ) , } ; } ; const serializeAws_json1_1UpdateLicenseSpecificationsForResourceRequest = ( input , context ) : any => { return { ... ( input . AddLicenseSpecifications !== undefined && input . AddLicenseSpecifications !== null && { AddLicenseSpecifications : serializeAws_json1_1LicenseSpecifications ( input . AddLicenseSpecifications , context ) , } ) , ... ( input . RemoveLicenseSpecifications !== undefined && input . RemoveLicenseSpecifications !== null && { RemoveLicenseSpecifications : serializeAws_json1_1LicenseSpecifications ( input . RemoveLicenseSpecifications , context ) , } ) , ... ( input . ResourceArn !== undefined && input . ResourceArn !== null && { ResourceArn : input . ResourceArn } ) , } ; } ; const serializeAws_json1_1UpdateServiceSettingsRequest = ( input , context ) : any => { return { ... ( input . EnableCrossAccountsDiscovery !== undefined && input . EnableCrossAccountsDiscovery !== null && { EnableCrossAccountsDiscovery : input . EnableCrossAccountsDiscovery , } ) , ... ( input . OrganizationConfiguration !== undefined && input . OrganizationConfiguration !== null && { OrganizationConfiguration : serializeAws_json1_1OrganizationConfiguration ( input . OrganizationConfiguration , context ) , } ) , ... ( input . S3BucketArn !== undefined && input . S3BucketArn !== null && { S3BucketArn : input . S3BucketArn } ) , ... ( input . SnsTopicArn !== undefined && input . SnsTopicArn !== null && { SnsTopicArn : input . SnsTopicArn } ) , } ; } ; const deserializeAws_json1_1AcceptGrantResponse = ( output , context ) : AcceptGrantResponse => { return { GrantArn : __expectString ( output . GrantArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1AccessDeniedException = ( output , context ) : AccessDeniedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1AllowedOperationList = ( output , context ) : ( AllowedOperation | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1ArnList = ( 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_1AuthorizationException = ( output , context ) : AuthorizationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1AutomatedDiscoveryInformation = ( output , context ) : AutomatedDiscoveryInformation => { return { LastRunTime : output . LastRunTime !== undefined && output . LastRunTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastRunTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1BorrowConfiguration = ( output , context ) : BorrowConfiguration => { return { AllowEarlyCheckIn : __expectBoolean ( output . AllowEarlyCheckIn ) , MaxTimeToLiveInMinutes : __expectInt32 ( output . MaxTimeToLiveInMinutes ) , } as any ; } ; const deserializeAws_json1_1CheckInLicenseResponse = ( output , context ) : CheckInLicenseResponse => { return { } as any ; } ; const deserializeAws_json1_1CheckoutBorrowLicenseResponse = ( output , context ) : CheckoutBorrowLicenseResponse => { return { CheckoutMetadata : output . CheckoutMetadata !== undefined && output . CheckoutMetadata !== null ? deserializeAws_json1_1MetadataList ( output . CheckoutMetadata , context ) : undefined , EntitlementsAllowed : output . EntitlementsAllowed !== undefined && output . EntitlementsAllowed !== null ? deserializeAws_json1_1EntitlementDataList ( output . EntitlementsAllowed , context ) : undefined , Expiration : __expectString ( output . Expiration ) , IssuedAt : __expectString ( output . IssuedAt ) , LicenseArn : __expectString ( output . LicenseArn ) , LicenseConsumptionToken : __expectString ( output . LicenseConsumptionToken ) , NodeId : __expectString ( output . NodeId ) , SignedToken : __expectString ( output . SignedToken ) , } as any ; } ; const deserializeAws_json1_1CheckoutLicenseResponse = ( output , context ) : CheckoutLicenseResponse => { return { CheckoutType : __expectString ( output . CheckoutType ) , EntitlementsAllowed : output . EntitlementsAllowed !== undefined && output . EntitlementsAllowed !== null ? deserializeAws_json1_1EntitlementDataList ( output . EntitlementsAllowed , context ) : undefined , Expiration : __expectString ( output . Expiration ) , IssuedAt : __expectString ( output . IssuedAt ) , LicenseArn : __expectString ( output . LicenseArn ) , LicenseConsumptionToken : __expectString ( output . LicenseConsumptionToken ) , NodeId : __expectString ( output . NodeId ) , SignedToken : __expectString ( output . SignedToken ) , } as any ; } ; const deserializeAws_json1_1ConflictException = ( output , context ) : ConflictException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ConsumedLicenseSummary = ( output , context ) : ConsumedLicenseSummary => { return { ConsumedLicenses : __expectLong ( output . ConsumedLicenses ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1ConsumedLicenseSummaryList = ( output , context ) : ConsumedLicenseSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ConsumedLicenseSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ConsumptionConfiguration = ( output , context ) : ConsumptionConfiguration => { return { BorrowConfiguration : output . BorrowConfiguration !== undefined && output . BorrowConfiguration !== null ? deserializeAws_json1_1BorrowConfiguration ( output . BorrowConfiguration , context ) : undefined , ProvisionalConfiguration : output . ProvisionalConfiguration !== undefined && output . ProvisionalConfiguration !== null ? deserializeAws_json1_1ProvisionalConfiguration ( output . ProvisionalConfiguration , context ) : undefined , RenewType : __expectString ( output . RenewType ) , } as any ; } ; const deserializeAws_json1_1CreateGrantResponse = ( output , context ) : CreateGrantResponse => { return { GrantArn : __expectString ( output . GrantArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1CreateGrantVersionResponse = ( output , context ) : CreateGrantVersionResponse => { return { GrantArn : __expectString ( output . GrantArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1CreateLicenseConfigurationResponse = ( output , context ) : CreateLicenseConfigurationResponse => { return { LicenseConfigurationArn : __expectString ( output . LicenseConfigurationArn ) , } as any ; } ; const deserializeAws_json1_1CreateLicenseConversionTaskForResourceResponse = ( output , context ) : CreateLicenseConversionTaskForResourceResponse => { return { LicenseConversionTaskId : __expectString ( output . LicenseConversionTaskId ) , } as any ; } ; const deserializeAws_json1_1CreateLicenseManagerReportGeneratorResponse = ( output , context ) : CreateLicenseManagerReportGeneratorResponse => { return { LicenseManagerReportGeneratorArn : __expectString ( output . LicenseManagerReportGeneratorArn ) , } as any ; } ; const deserializeAws_json1_1CreateLicenseResponse = ( output , context ) : CreateLicenseResponse => { return { LicenseArn : __expectString ( output . LicenseArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1CreateLicenseVersionResponse = ( output , context ) : CreateLicenseVersionResponse => { return { LicenseArn : __expectString ( output . LicenseArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1CreateTokenResponse = ( output , context ) : CreateTokenResponse => { return { Token : __expectString ( output . Token ) , TokenId : __expectString ( output . TokenId ) , TokenType : __expectString ( output . TokenType ) , } as any ; } ; const deserializeAws_json1_1DatetimeRange = ( output , context ) : DatetimeRange => { return { Begin : __expectString ( output . Begin ) , End : __expectString ( output . End ) , } as any ; } ; const deserializeAws_json1_1DeleteGrantResponse = ( output , context ) : DeleteGrantResponse => { return { GrantArn : __expectString ( output . GrantArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1DeleteLicenseConfigurationResponse = ( output , context ) : DeleteLicenseConfigurationResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteLicenseManagerReportGeneratorResponse = ( output , context ) : DeleteLicenseManagerReportGeneratorResponse => { return { } as any ; } ; const deserializeAws_json1_1DeleteLicenseResponse = ( output , context ) : DeleteLicenseResponse => { return { DeletionDate : __expectString ( output . DeletionDate ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1DeleteTokenResponse = ( output , context ) : DeleteTokenResponse => { return { } as any ; } ; const deserializeAws_json1_1Entitlement = ( output , context ) : Entitlement => { return { AllowCheckIn : __expectBoolean ( output . AllowCheckIn ) , MaxCount : __expectLong ( output . MaxCount ) , Name : __expectString ( output . Name ) , Overage : __expectBoolean ( output . Overage ) , Unit : __expectString ( output . Unit ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1EntitlementData = ( output , context ) : EntitlementData => { return { Name : __expectString ( output . Name ) , Unit : __expectString ( output . Unit ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1EntitlementDataList = ( output , context ) : EntitlementData [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EntitlementData ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1EntitlementList = ( output , context ) : Entitlement [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Entitlement ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1EntitlementNotAllowedException = ( output , context ) : EntitlementNotAllowedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1EntitlementUsage = ( output , context ) : EntitlementUsage => { return { ConsumedValue : __expectString ( output . ConsumedValue ) , MaxCount : __expectString ( output . MaxCount ) , Name : __expectString ( output . Name ) , Unit : __expectString ( output . Unit ) , } as any ; } ; const deserializeAws_json1_1EntitlementUsageList = ( output , context ) : EntitlementUsage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EntitlementUsage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ExtendLicenseConsumptionResponse = ( output , context ) : ExtendLicenseConsumptionResponse => { return { Expiration : __expectString ( output . Expiration ) , LicenseConsumptionToken : __expectString ( output . LicenseConsumptionToken ) , } as any ; } ; const deserializeAws_json1_1FailedDependencyException = ( output , context ) : FailedDependencyException => { return { ErrorCode : __expectString ( output . ErrorCode ) , Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1FilterLimitExceededException = ( output , context ) : FilterLimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1GetAccessTokenResponse = ( output , context ) : GetAccessTokenResponse => { return { AccessToken : __expectString ( output . AccessToken ) , } as any ; } ; const deserializeAws_json1_1GetGrantResponse = ( output , context ) : GetGrantResponse => { return { Grant : output . Grant !== undefined && output . Grant !== null ? deserializeAws_json1_1Grant ( output . Grant , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLicenseConfigurationResponse = ( output , context ) : GetLicenseConfigurationResponse => { return { AutomatedDiscoveryInformation : output . AutomatedDiscoveryInformation !== undefined && output . AutomatedDiscoveryInformation !== null ? deserializeAws_json1_1AutomatedDiscoveryInformation ( output . AutomatedDiscoveryInformation , context ) : undefined , ConsumedLicenseSummaryList : output . ConsumedLicenseSummaryList !== undefined && output . ConsumedLicenseSummaryList !== null ? deserializeAws_json1_1ConsumedLicenseSummaryList ( output . ConsumedLicenseSummaryList , context ) : undefined , ConsumedLicenses : __expectLong ( output . ConsumedLicenses ) , Description : __expectString ( output . Description ) , DisassociateWhenNotFound : __expectBoolean ( output . DisassociateWhenNotFound ) , LicenseConfigurationArn : __expectString ( output . LicenseConfigurationArn ) , LicenseConfigurationId : __expectString ( output . LicenseConfigurationId ) , LicenseCount : __expectLong ( output . LicenseCount ) , LicenseCountHardLimit : __expectBoolean ( output . LicenseCountHardLimit ) , LicenseCountingType : __expectString ( output . LicenseCountingType ) , LicenseRules : output . LicenseRules !== undefined && output . LicenseRules !== null ? deserializeAws_json1_1StringList ( output . LicenseRules , context ) : undefined , ManagedResourceSummaryList : output . ManagedResourceSummaryList !== undefined && output . ManagedResourceSummaryList !== null ? deserializeAws_json1_1ManagedResourceSummaryList ( output . ManagedResourceSummaryList , context ) : undefined , Name : __expectString ( output . Name ) , OwnerAccountId : __expectString ( output . OwnerAccountId ) , ProductInformationList : output . ProductInformationList !== undefined && output . ProductInformationList !== null ? deserializeAws_json1_1ProductInformationList ( output . ProductInformationList , context ) : undefined , Status : __expectString ( output . Status ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLicenseConversionTaskResponse = ( output , context ) : GetLicenseConversionTaskResponse => { return { DestinationLicenseContext : output . DestinationLicenseContext !== undefined && output . DestinationLicenseContext !== null ? deserializeAws_json1_1LicenseConversionContext ( output . DestinationLicenseContext , context ) : undefined , EndTime : output . EndTime !== undefined && output . EndTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . EndTime ) ) ) : undefined , LicenseConversionTaskId : __expectString ( output . LicenseConversionTaskId ) , LicenseConversionTime : output . LicenseConversionTime !== undefined && output . LicenseConversionTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LicenseConversionTime ) ) ) : undefined , ResourceArn : __expectString ( output . ResourceArn ) , SourceLicenseContext : output . SourceLicenseContext !== undefined && output . SourceLicenseContext !== null ? deserializeAws_json1_1LicenseConversionContext ( output . SourceLicenseContext , context ) : undefined , StartTime : output . StartTime !== undefined && output . StartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartTime ) ) ) : undefined , Status : __expectString ( output . Status ) , StatusMessage : __expectString ( output . StatusMessage ) , } as any ; } ; const deserializeAws_json1_1GetLicenseManagerReportGeneratorResponse = ( output , context ) : GetLicenseManagerReportGeneratorResponse => { return { ReportGenerator : output . ReportGenerator !== undefined && output . ReportGenerator !== null ? deserializeAws_json1_1ReportGenerator ( output . ReportGenerator , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLicenseResponse = ( output , context ) : GetLicenseResponse => { return { License : output . License !== undefined && output . License !== null ? deserializeAws_json1_1License ( output . License , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLicenseUsageResponse = ( output , context ) : GetLicenseUsageResponse => { return { LicenseUsage : output . LicenseUsage !== undefined && output . LicenseUsage !== null ? deserializeAws_json1_1LicenseUsage ( output . LicenseUsage , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetServiceSettingsResponse = ( output , context ) : GetServiceSettingsResponse => { return { EnableCrossAccountsDiscovery : __expectBoolean ( output . EnableCrossAccountsDiscovery ) , LicenseManagerResourceShareArn : __expectString ( output . LicenseManagerResourceShareArn ) , OrganizationConfiguration : output . OrganizationConfiguration !== undefined && output . OrganizationConfiguration !== null ? deserializeAws_json1_1OrganizationConfiguration ( output . OrganizationConfiguration , context ) : undefined , S3BucketArn : __expectString ( output . S3BucketArn ) , SnsTopicArn : __expectString ( output . SnsTopicArn ) , } as any ; } ; const deserializeAws_json1_1Grant = ( output , context ) : Grant => { return { GrantArn : __expectString ( output . GrantArn ) , GrantName : __expectString ( output . GrantName ) , GrantStatus : __expectString ( output . GrantStatus ) , GrantedOperations : output . GrantedOperations !== undefined && output . GrantedOperations !== null ? deserializeAws_json1_1AllowedOperationList ( output . GrantedOperations , context ) : undefined , GranteePrincipalArn : __expectString ( output . GranteePrincipalArn ) , HomeRegion : __expectString ( output . HomeRegion ) , LicenseArn : __expectString ( output . LicenseArn ) , ParentArn : __expectString ( output . ParentArn ) , StatusReason : __expectString ( output . StatusReason ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1GrantedLicense = ( output , context ) : GrantedLicense => { return { Beneficiary : __expectString ( output . Beneficiary ) , ConsumptionConfiguration : output . ConsumptionConfiguration !== undefined && output . ConsumptionConfiguration !== null ? deserializeAws_json1_1ConsumptionConfiguration ( output . ConsumptionConfiguration , context ) : undefined , CreateTime : __expectString ( output . CreateTime ) , Entitlements : output . Entitlements !== undefined && output . Entitlements !== null ? deserializeAws_json1_1EntitlementList ( output . Entitlements , context ) : undefined , HomeRegion : __expectString ( output . HomeRegion ) , Issuer : output . Issuer !== undefined && output . Issuer !== null ? deserializeAws_json1_1IssuerDetails ( output . Issuer , context ) : undefined , LicenseArn : __expectString ( output . LicenseArn ) , LicenseMetadata : output . LicenseMetadata !== undefined && output . LicenseMetadata !== null ? deserializeAws_json1_1MetadataList ( output . LicenseMetadata , context ) : undefined , LicenseName : __expectString ( output . LicenseName ) , ProductName : __expectString ( output . ProductName ) , ProductSKU : __expectString ( output . ProductSKU ) , ReceivedMetadata : output . ReceivedMetadata !== undefined && output . ReceivedMetadata !== null ? deserializeAws_json1_1ReceivedMetadata ( output . ReceivedMetadata , context ) : undefined , Status : __expectString ( output . Status ) , Validity : output . Validity !== undefined && output . Validity !== null ? deserializeAws_json1_1DatetimeRange ( output . Validity , context ) : undefined , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1GrantedLicenseList = ( output , context ) : GrantedLicense [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1GrantedLicense ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1GrantList = ( output , context ) : Grant [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Grant ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1InvalidParameterValueException = ( output , context ) : InvalidParameterValueException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1InvalidResourceStateException = ( output , context ) : InvalidResourceStateException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1IssuerDetails = ( output , context ) : IssuerDetails => { return { KeyFingerprint : __expectString ( output . KeyFingerprint ) , Name : __expectString ( output . Name ) , SignKey : __expectString ( output . SignKey ) , } as any ; } ; const deserializeAws_json1_1License = ( output , context ) : License => { return { Beneficiary : __expectString ( output . Beneficiary ) , ConsumptionConfiguration : output . ConsumptionConfiguration !== undefined && output . ConsumptionConfiguration !== null ? deserializeAws_json1_1ConsumptionConfiguration ( output . ConsumptionConfiguration , context ) : undefined , CreateTime : __expectString ( output . CreateTime ) , Entitlements : output . Entitlements !== undefined && output . Entitlements !== null ? deserializeAws_json1_1EntitlementList ( output . Entitlements , context ) : undefined , HomeRegion : __expectString ( output . HomeRegion ) , Issuer : output . Issuer !== undefined && output . Issuer !== null ? deserializeAws_json1_1IssuerDetails ( output . Issuer , context ) : undefined , LicenseArn : __expectString ( output . LicenseArn ) , LicenseMetadata : output . LicenseMetadata !== undefined && output . LicenseMetadata !== null ? deserializeAws_json1_1MetadataList ( output . LicenseMetadata , context ) : undefined , LicenseName : __expectString ( output . LicenseName ) , ProductName : __expectString ( output . ProductName ) , ProductSKU : __expectString ( output . ProductSKU ) , Status : __expectString ( output . Status ) , Validity : output . Validity !== undefined && output . Validity !== null ? deserializeAws_json1_1DatetimeRange ( output . Validity , context ) : undefined , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1LicenseConfiguration = ( output , context ) : LicenseConfiguration => { return { AutomatedDiscoveryInformation : output . AutomatedDiscoveryInformation !== undefined && output . AutomatedDiscoveryInformation !== null ? deserializeAws_json1_1AutomatedDiscoveryInformation ( output . AutomatedDiscoveryInformation , context ) : undefined , ConsumedLicenseSummaryList : output . ConsumedLicenseSummaryList !== undefined && output . ConsumedLicenseSummaryList !== null ? deserializeAws_json1_1ConsumedLicenseSummaryList ( output . ConsumedLicenseSummaryList , context ) : undefined , ConsumedLicenses : __expectLong ( output . ConsumedLicenses ) , Description : __expectString ( output . Description ) , DisassociateWhenNotFound : __expectBoolean ( output . DisassociateWhenNotFound ) , LicenseConfigurationArn : __expectString ( output . LicenseConfigurationArn ) , LicenseConfigurationId : __expectString ( output . LicenseConfigurationId ) , LicenseCount : __expectLong ( output . LicenseCount ) , LicenseCountHardLimit : __expectBoolean ( output . LicenseCountHardLimit ) , LicenseCountingType : __expectString ( output . LicenseCountingType ) , LicenseRules : output . LicenseRules !== undefined && output . LicenseRules !== null ? deserializeAws_json1_1StringList ( output . LicenseRules , context ) : undefined , ManagedResourceSummaryList : output . ManagedResourceSummaryList !== undefined && output . ManagedResourceSummaryList !== null ? deserializeAws_json1_1ManagedResourceSummaryList ( output . ManagedResourceSummaryList , context ) : undefined , Name : __expectString ( output . Name ) , OwnerAccountId : __expectString ( output . OwnerAccountId ) , ProductInformationList : output . ProductInformationList !== undefined && output . ProductInformationList !== null ? deserializeAws_json1_1ProductInformationList ( output . ProductInformationList , context ) : undefined , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_json1_1LicenseConfigurationAssociation = ( output , context ) : LicenseConfigurationAssociation => { return { AmiAssociationScope : __expectString ( output . AmiAssociationScope ) , AssociationTime : output . AssociationTime !== undefined && output . AssociationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . AssociationTime ) ) ) : undefined , ResourceArn : __expectString ( output . ResourceArn ) , ResourceOwnerId : __expectString ( output . ResourceOwnerId ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1LicenseConfigurationAssociations = ( output , context ) : LicenseConfigurationAssociation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseConfigurationAssociation ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseConfigurations = ( output , context ) : LicenseConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseConfigurationUsage = ( output , context ) : LicenseConfigurationUsage => { return { AssociationTime : output . AssociationTime !== undefined && output . AssociationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . AssociationTime ) ) ) : undefined , ConsumedLicenses : __expectLong ( output . ConsumedLicenses ) , ResourceArn : __expectString ( output . ResourceArn ) , ResourceOwnerId : __expectString ( output . ResourceOwnerId ) , ResourceStatus : __expectString ( output . ResourceStatus ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1LicenseConfigurationUsageList = ( output , context ) : LicenseConfigurationUsage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseConfigurationUsage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseConversionContext = ( output , context ) : LicenseConversionContext => { return { UsageOperation : __expectString ( output . UsageOperation ) , } as any ; } ; const deserializeAws_json1_1LicenseConversionTask = ( output , context ) : LicenseConversionTask => { return { DestinationLicenseContext : output . DestinationLicenseContext !== undefined && output . DestinationLicenseContext !== null ? deserializeAws_json1_1LicenseConversionContext ( output . DestinationLicenseContext , context ) : undefined , EndTime : output . EndTime !== undefined && output . EndTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . EndTime ) ) ) : undefined , LicenseConversionTaskId : __expectString ( output . LicenseConversionTaskId ) , LicenseConversionTime : output . LicenseConversionTime !== undefined && output . LicenseConversionTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LicenseConversionTime ) ) ) : undefined , ResourceArn : __expectString ( output . ResourceArn ) , SourceLicenseContext : output . SourceLicenseContext !== undefined && output . SourceLicenseContext !== null ? deserializeAws_json1_1LicenseConversionContext ( output . SourceLicenseContext , context ) : undefined , StartTime : output . StartTime !== undefined && output . StartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartTime ) ) ) : undefined , Status : __expectString ( output . Status ) , StatusMessage : __expectString ( output . StatusMessage ) , } as any ; } ; const deserializeAws_json1_1LicenseConversionTasks = ( output , context ) : LicenseConversionTask [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseConversionTask ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseList = ( output , context ) : License [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1License ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseOperationFailure = ( output , context ) : LicenseOperationFailure => { return { ErrorMessage : __expectString ( output . ErrorMessage ) , FailureTime : output . FailureTime !== undefined && output . FailureTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . FailureTime ) ) ) : undefined , MetadataList : output . MetadataList !== undefined && output . MetadataList !== null ? deserializeAws_json1_1MetadataList ( output . MetadataList , context ) : undefined , OperationName : __expectString ( output . OperationName ) , OperationRequestedBy : __expectString ( output . OperationRequestedBy ) , ResourceArn : __expectString ( output . ResourceArn ) , ResourceOwnerId : __expectString ( output . ResourceOwnerId ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1LicenseOperationFailureList = ( output , context ) : LicenseOperationFailure [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseOperationFailure ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseSpecification = ( output , context ) : LicenseSpecification => { return { AmiAssociationScope : __expectString ( output . AmiAssociationScope ) , LicenseConfigurationArn : __expectString ( output . LicenseConfigurationArn ) , } as any ; } ; const deserializeAws_json1_1LicenseSpecifications = ( output , context ) : LicenseSpecification [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LicenseSpecification ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LicenseUsage = ( output , context ) : LicenseUsage => { return { EntitlementUsages : output . EntitlementUsages !== undefined && output . EntitlementUsages !== null ? deserializeAws_json1_1EntitlementUsageList ( output . EntitlementUsages , context ) : undefined , } as any ; } ; const deserializeAws_json1_1LicenseUsageException = ( output , context ) : LicenseUsageException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ListAssociationsForLicenseConfigurationResponse = ( output , context ) : ListAssociationsForLicenseConfigurationResponse => { return { LicenseConfigurationAssociations : output . LicenseConfigurationAssociations !== undefined && output . LicenseConfigurationAssociations !== null ? deserializeAws_json1_1LicenseConfigurationAssociations ( output . LicenseConfigurationAssociations , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListDistributedGrantsResponse = ( output , context ) : ListDistributedGrantsResponse => { return { Grants : output . Grants !== undefined && output . Grants !== null ? deserializeAws_json1_1GrantList ( output . Grants , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListFailuresForLicenseConfigurationOperationsResponse = ( output , context ) : ListFailuresForLicenseConfigurationOperationsResponse => { return { LicenseOperationFailureList : output . LicenseOperationFailureList !== undefined && output . LicenseOperationFailureList !== null ? deserializeAws_json1_1LicenseOperationFailureList ( output . LicenseOperationFailureList , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListLicenseConfigurationsResponse = ( output , context ) : ListLicenseConfigurationsResponse => { return { LicenseConfigurations : output . LicenseConfigurations !== undefined && output . LicenseConfigurations !== null ? deserializeAws_json1_1LicenseConfigurations ( output . LicenseConfigurations , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListLicenseConversionTasksResponse = ( output , context ) : ListLicenseConversionTasksResponse => { return { LicenseConversionTasks : output . LicenseConversionTasks !== undefined && output . LicenseConversionTasks !== null ? deserializeAws_json1_1LicenseConversionTasks ( output . LicenseConversionTasks , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListLicenseManagerReportGeneratorsResponse = ( output , context ) : ListLicenseManagerReportGeneratorsResponse => { return { NextToken : __expectString ( output . NextToken ) , ReportGenerators : output . ReportGenerators !== undefined && output . ReportGenerators !== null ? deserializeAws_json1_1ReportGeneratorList ( output . ReportGenerators , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListLicenseSpecificationsForResourceResponse = ( output , context ) : ListLicenseSpecificationsForResourceResponse => { return { LicenseSpecifications : output . LicenseSpecifications !== undefined && output . LicenseSpecifications !== null ? deserializeAws_json1_1LicenseSpecifications ( output . LicenseSpecifications , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListLicensesResponse = ( output , context ) : ListLicensesResponse => { return { Licenses : output . Licenses !== undefined && output . Licenses !== null ? deserializeAws_json1_1LicenseList ( output . Licenses , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListLicenseVersionsResponse = ( output , context ) : ListLicenseVersionsResponse => { return { Licenses : output . Licenses !== undefined && output . Licenses !== null ? deserializeAws_json1_1LicenseList ( output . Licenses , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListReceivedGrantsResponse = ( output , context ) : ListReceivedGrantsResponse => { return { Grants : output . Grants !== undefined && output . Grants !== null ? deserializeAws_json1_1GrantList ( output . Grants , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListReceivedLicensesResponse = ( output , context ) : ListReceivedLicensesResponse => { return { Licenses : output . Licenses !== undefined && output . Licenses !== null ? deserializeAws_json1_1GrantedLicenseList ( output . Licenses , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ListResourceInventoryResponse = ( output , context ) : ListResourceInventoryResponse => { return { NextToken : __expectString ( output . NextToken ) , ResourceInventoryList : output . ResourceInventoryList !== undefined && output . ResourceInventoryList !== null ? deserializeAws_json1_1ResourceInventoryList ( output . ResourceInventoryList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTagsForResourceResponse = ( output , context ) : ListTagsForResourceResponse => { return { Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListTokensResponse = ( output , context ) : ListTokensResponse => { return { NextToken : __expectString ( output . NextToken ) , Tokens : output . Tokens !== undefined && output . Tokens !== null ? deserializeAws_json1_1TokenList ( output . Tokens , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ListUsageForLicenseConfigurationResponse = ( output , context ) : ListUsageForLicenseConfigurationResponse => { return { LicenseConfigurationUsageList : output . LicenseConfigurationUsageList !== undefined && output . LicenseConfigurationUsageList !== null ? deserializeAws_json1_1LicenseConfigurationUsageList ( output . LicenseConfigurationUsageList , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1ManagedResourceSummary = ( output , context ) : ManagedResourceSummary => { return { AssociationCount : __expectLong ( output . AssociationCount ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1ManagedResourceSummaryList = ( output , context ) : ManagedResourceSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ManagedResourceSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1MaxSize3StringList = ( 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_1Metadata = ( output , context ) : Metadata => { return { Name : __expectString ( output . Name ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1MetadataList = ( output , context ) : Metadata [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Metadata ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1NoEntitlementsAllowedException = ( output , context ) : NoEntitlementsAllowedException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1OrganizationConfiguration = ( output , context ) : OrganizationConfiguration => { return { EnableIntegration : __expectBoolean ( output . EnableIntegration ) , } as any ; } ; const deserializeAws_json1_1ProductInformation = ( output , context ) : ProductInformation => { return { ProductInformationFilterList : output . ProductInformationFilterList !== undefined && output . ProductInformationFilterList !== null ? deserializeAws_json1_1ProductInformationFilterList ( output . ProductInformationFilterList , context ) : undefined , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1ProductInformationFilter = ( output , context ) : ProductInformationFilter => { return { ProductInformationFilterComparator : __expectString ( output . ProductInformationFilterComparator ) , ProductInformationFilterName : __expectString ( output . ProductInformationFilterName ) , ProductInformationFilterValue : output . ProductInformationFilterValue !== undefined && output . ProductInformationFilterValue !== null ? deserializeAws_json1_1StringList ( output . ProductInformationFilterValue , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ProductInformationFilterList = ( output , context ) : ProductInformationFilter [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ProductInformationFilter ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ProductInformationList = ( output , context ) : ProductInformation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ProductInformation ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ProvisionalConfiguration = ( output , context ) : ProvisionalConfiguration => { return { MaxTimeToLiveInMinutes : __expectInt32 ( output . MaxTimeToLiveInMinutes ) , } as any ; } ; const deserializeAws_json1_1RateLimitExceededException = ( output , context ) : RateLimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ReceivedMetadata = ( output , context ) : ReceivedMetadata => { return { AllowedOperations : output . AllowedOperations !== undefined && output . AllowedOperations !== null ? deserializeAws_json1_1AllowedOperationList ( output . AllowedOperations , context ) : undefined , ReceivedStatus : __expectString ( output . ReceivedStatus ) , ReceivedStatusReason : __expectString ( output . ReceivedStatusReason ) , } as any ; } ; const deserializeAws_json1_1RedirectException = ( output , context ) : RedirectException => { return { Location : __expectString ( output . Location ) , Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1RejectGrantResponse = ( output , context ) : RejectGrantResponse => { return { GrantArn : __expectString ( output . GrantArn ) , Status : __expectString ( output . Status ) , Version : __expectString ( output . Version ) , } as any ; } ; const deserializeAws_json1_1ReportContext = ( output , context ) : ReportContext => { return { licenseConfigurationArns : output . licenseConfigurationArns !== undefined && output . licenseConfigurationArns !== null ? deserializeAws_json1_1ArnList ( output . licenseConfigurationArns , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReportFrequency = ( output , context ) : ReportFrequency => { return { period : __expectString ( output . period ) , value : __expectInt32 ( output . value ) , } as any ; } ; const deserializeAws_json1_1ReportGenerator = ( output , context ) : ReportGenerator => { return { CreateTime : __expectString ( output . CreateTime ) , Description : __expectString ( output . Description ) , LastReportGenerationTime : __expectString ( output . LastReportGenerationTime ) , LastRunFailureReason : __expectString ( output . LastRunFailureReason ) , LastRunStatus : __expectString ( output . LastRunStatus ) , LicenseManagerReportGeneratorArn : __expectString ( output . LicenseManagerReportGeneratorArn ) , ReportContext : output . ReportContext !== undefined && output . ReportContext !== null ? deserializeAws_json1_1ReportContext ( output . ReportContext , context ) : undefined , ReportCreatorAccount : __expectString ( output . ReportCreatorAccount ) , ReportFrequency : output . ReportFrequency !== undefined && output . ReportFrequency !== null ? deserializeAws_json1_1ReportFrequency ( output . ReportFrequency , context ) : undefined , ReportGeneratorName : __expectString ( output . ReportGeneratorName ) , ReportType : output . ReportType !== undefined && output . ReportType !== null ? deserializeAws_json1_1ReportTypeList ( output . ReportType , context ) : undefined , S3Location : output . S3Location !== undefined && output . S3Location !== null ? deserializeAws_json1_1S3Location ( output . S3Location , context ) : undefined , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReportGeneratorList = ( output , context ) : ReportGenerator [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReportGenerator ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ReportTypeList = ( output , context ) : ( ReportType | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1ResourceInventory = ( output , context ) : ResourceInventory => { return { Platform : __expectString ( output . Platform ) , PlatformVersion : __expectString ( output . PlatformVersion ) , ResourceArn : __expectString ( output . ResourceArn ) , ResourceId : __expectString ( output . ResourceId ) , ResourceOwningAccountId : __expectString ( output . ResourceOwningAccountId ) , ResourceType : __expectString ( output . ResourceType ) , } as any ; } ; const deserializeAws_json1_1ResourceInventoryList = ( output , context ) : ResourceInventory [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ResourceInventory ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ResourceLimitExceededException = ( output , context ) : ResourceLimitExceededException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1S3Location = ( output , context ) : S3Location => { return { bucket : __expectString ( output . bucket ) , keyPrefix : __expectString ( output . keyPrefix ) , } as any ; } ; const deserializeAws_json1_1ServerInternalException = ( output , context ) : ServerInternalException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1StringList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TagResourceResponse = ( output , context ) : TagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1TokenData = ( output , context ) : TokenData => { return { ExpirationTime : __expectString ( output . ExpirationTime ) , LicenseArn : __expectString ( output . LicenseArn ) , RoleArns : output . RoleArns !== undefined && output . RoleArns !== null ? deserializeAws_json1_1ArnList ( output . RoleArns , context ) : undefined , Status : __expectString ( output . Status ) , TokenId : __expectString ( output . TokenId ) , TokenProperties : output . TokenProperties !== undefined && output . TokenProperties !== null ? deserializeAws_json1_1MaxSize3StringList ( output . TokenProperties , context ) : undefined , TokenType : __expectString ( output . TokenType ) , } as any ; } ; const deserializeAws_json1_1TokenList = ( output , context ) : TokenData [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1TokenData ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1UnsupportedDigitalSignatureMethodException = ( output , context ) : UnsupportedDigitalSignatureMethodException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeAws_json1_1UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateLicenseConfigurationResponse = ( output , context ) : UpdateLicenseConfigurationResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateLicenseManagerReportGeneratorResponse = ( output , context ) : UpdateLicenseManagerReportGeneratorResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateLicenseSpecificationsForResourceResponse = ( output , context ) : UpdateLicenseSpecificationsForResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UpdateServiceSettingsResponse = ( output , context ) : UpdateServiceSettingsResponse => { return { } as any ; } ; const deserializeAws_json1_1ValidationException = ( output , context ) : ValidationException => { return { Message : __expectString ( output . Message ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;