import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , limitedParseDouble as __limitedParseDouble , 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 { BatchCheckLayerAvailabilityCommandInput , BatchCheckLayerAvailabilityCommandOutput , } from "../commands/BatchCheckLayerAvailabilityCommand" ; import { BatchDeleteImageCommandInput , BatchDeleteImageCommandOutput } from "../commands/BatchDeleteImageCommand" ; import { BatchGetImageCommandInput , BatchGetImageCommandOutput } from "../commands/BatchGetImageCommand" ; import { BatchGetRepositoryScanningConfigurationCommandInput , BatchGetRepositoryScanningConfigurationCommandOutput , } from "../commands/BatchGetRepositoryScanningConfigurationCommand" ; import { CompleteLayerUploadCommandInput , CompleteLayerUploadCommandOutput , } from "../commands/CompleteLayerUploadCommand" ; import { CreatePullThroughCacheRuleCommandInput , CreatePullThroughCacheRuleCommandOutput , } from "../commands/CreatePullThroughCacheRuleCommand" ; import { CreateRepositoryCommandInput , CreateRepositoryCommandOutput } from "../commands/CreateRepositoryCommand" ; import { DeleteLifecyclePolicyCommandInput , DeleteLifecyclePolicyCommandOutput , } from "../commands/DeleteLifecyclePolicyCommand" ; import { DeletePullThroughCacheRuleCommandInput , DeletePullThroughCacheRuleCommandOutput , } from "../commands/DeletePullThroughCacheRuleCommand" ; import { DeleteRegistryPolicyCommandInput , DeleteRegistryPolicyCommandOutput , } from "../commands/DeleteRegistryPolicyCommand" ; import { DeleteRepositoryCommandInput , DeleteRepositoryCommandOutput } from "../commands/DeleteRepositoryCommand" ; import { DeleteRepositoryPolicyCommandInput , DeleteRepositoryPolicyCommandOutput , } from "../commands/DeleteRepositoryPolicyCommand" ; import { DescribeImageReplicationStatusCommandInput , DescribeImageReplicationStatusCommandOutput , } from "../commands/DescribeImageReplicationStatusCommand" ; import { DescribeImageScanFindingsCommandInput , DescribeImageScanFindingsCommandOutput , } from "../commands/DescribeImageScanFindingsCommand" ; import { DescribeImagesCommandInput , DescribeImagesCommandOutput } from "../commands/DescribeImagesCommand" ; import { DescribePullThroughCacheRulesCommandInput , DescribePullThroughCacheRulesCommandOutput , } from "../commands/DescribePullThroughCacheRulesCommand" ; import { DescribeRegistryCommandInput , DescribeRegistryCommandOutput } from "../commands/DescribeRegistryCommand" ; import { DescribeRepositoriesCommandInput , DescribeRepositoriesCommandOutput , } from "../commands/DescribeRepositoriesCommand" ; import { GetAuthorizationTokenCommandInput , GetAuthorizationTokenCommandOutput , } from "../commands/GetAuthorizationTokenCommand" ; import { GetDownloadUrlForLayerCommandInput , GetDownloadUrlForLayerCommandOutput , } from "../commands/GetDownloadUrlForLayerCommand" ; import { GetLifecyclePolicyCommandInput , GetLifecyclePolicyCommandOutput } from "../commands/GetLifecyclePolicyCommand" ; import { GetLifecyclePolicyPreviewCommandInput , GetLifecyclePolicyPreviewCommandOutput , } from "../commands/GetLifecyclePolicyPreviewCommand" ; import { GetRegistryPolicyCommandInput , GetRegistryPolicyCommandOutput } from "../commands/GetRegistryPolicyCommand" ; import { GetRegistryScanningConfigurationCommandInput , GetRegistryScanningConfigurationCommandOutput , } from "../commands/GetRegistryScanningConfigurationCommand" ; import { GetRepositoryPolicyCommandInput , GetRepositoryPolicyCommandOutput , } from "../commands/GetRepositoryPolicyCommand" ; import { InitiateLayerUploadCommandInput , InitiateLayerUploadCommandOutput , } from "../commands/InitiateLayerUploadCommand" ; import { ListImagesCommandInput , ListImagesCommandOutput } from "../commands/ListImagesCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { PutImageCommandInput , PutImageCommandOutput } from "../commands/PutImageCommand" ; import { PutImageScanningConfigurationCommandInput , PutImageScanningConfigurationCommandOutput , } from "../commands/PutImageScanningConfigurationCommand" ; import { PutImageTagMutabilityCommandInput , PutImageTagMutabilityCommandOutput , } from "../commands/PutImageTagMutabilityCommand" ; import { PutLifecyclePolicyCommandInput , PutLifecyclePolicyCommandOutput } from "../commands/PutLifecyclePolicyCommand" ; import { PutRegistryPolicyCommandInput , PutRegistryPolicyCommandOutput } from "../commands/PutRegistryPolicyCommand" ; import { PutRegistryScanningConfigurationCommandInput , PutRegistryScanningConfigurationCommandOutput , } from "../commands/PutRegistryScanningConfigurationCommand" ; import { PutReplicationConfigurationCommandInput , PutReplicationConfigurationCommandOutput , } from "../commands/PutReplicationConfigurationCommand" ; import { SetRepositoryPolicyCommandInput , SetRepositoryPolicyCommandOutput , } from "../commands/SetRepositoryPolicyCommand" ; import { StartImageScanCommandInput , StartImageScanCommandOutput } from "../commands/StartImageScanCommand" ; import { StartLifecyclePolicyPreviewCommandInput , StartLifecyclePolicyPreviewCommandOutput , } from "../commands/StartLifecyclePolicyPreviewCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UploadLayerPartCommandInput , UploadLayerPartCommandOutput } from "../commands/UploadLayerPartCommand" ; import { Attribute , AuthorizationData , AwsEcrContainerImageDetails , BatchCheckLayerAvailabilityRequest , BatchCheckLayerAvailabilityResponse , BatchDeleteImageRequest , BatchDeleteImageResponse , BatchGetImageRequest , BatchGetImageResponse , BatchGetRepositoryScanningConfigurationRequest , BatchGetRepositoryScanningConfigurationResponse , CompleteLayerUploadRequest , CompleteLayerUploadResponse , CreatePullThroughCacheRuleRequest , CreatePullThroughCacheRuleResponse , CreateRepositoryRequest , CreateRepositoryResponse , CvssScore , CvssScoreAdjustment , CvssScoreDetails , DeleteLifecyclePolicyRequest , DeleteLifecyclePolicyResponse , DeletePullThroughCacheRuleRequest , DeletePullThroughCacheRuleResponse , DeleteRegistryPolicyRequest , DeleteRegistryPolicyResponse , DeleteRepositoryPolicyRequest , DeleteRepositoryPolicyResponse , DeleteRepositoryRequest , DeleteRepositoryResponse , DescribeImageReplicationStatusRequest , DescribeImageReplicationStatusResponse , DescribeImageScanFindingsRequest , DescribeImageScanFindingsResponse , DescribeImagesFilter , DescribeImagesRequest , DescribeImagesResponse , DescribePullThroughCacheRulesRequest , DescribePullThroughCacheRulesResponse , DescribeRegistryRequest , DescribeRegistryResponse , DescribeRepositoriesRequest , DescribeRepositoriesResponse , EmptyUploadException , EncryptionConfiguration , EnhancedImageScanFinding , FindingSeverity , GetAuthorizationTokenRequest , GetAuthorizationTokenResponse , GetDownloadUrlForLayerRequest , GetDownloadUrlForLayerResponse , GetLifecyclePolicyPreviewRequest , GetLifecyclePolicyPreviewResponse , GetLifecyclePolicyRequest , GetLifecyclePolicyResponse , GetRegistryPolicyRequest , GetRegistryPolicyResponse , GetRegistryScanningConfigurationRequest , GetRegistryScanningConfigurationResponse , GetRepositoryPolicyRequest , GetRepositoryPolicyResponse , Image , ImageAlreadyExistsException , ImageDetail , ImageDigestDoesNotMatchException , ImageFailure , ImageIdentifier , ImageNotFoundException , ImageReplicationStatus , ImageScanFinding , ImageScanFindings , ImageScanFindingsSummary , ImageScanningConfiguration , ImageScanStatus , ImageTagAlreadyExistsException , InitiateLayerUploadRequest , InitiateLayerUploadResponse , InvalidLayerException , InvalidLayerPartException , InvalidParameterException , InvalidTagParameterException , KmsException , Layer , LayerAlreadyExistsException , LayerFailure , LayerInaccessibleException , LayerPartTooSmallException , LayersNotFoundException , LifecyclePolicyNotFoundException , LifecyclePolicyPreviewFilter , LifecyclePolicyPreviewInProgressException , LifecyclePolicyPreviewNotFoundException , LifecyclePolicyPreviewResult , LifecyclePolicyPreviewSummary , LifecyclePolicyRuleAction , LimitExceededException , ListImagesFilter , ListImagesRequest , ListImagesResponse , ListTagsForResourceRequest , ListTagsForResourceResponse , PackageVulnerabilityDetails , PullThroughCacheRule , PullThroughCacheRuleAlreadyExistsException , PullThroughCacheRuleNotFoundException , PutImageRequest , PutImageResponse , PutImageScanningConfigurationRequest , PutImageScanningConfigurationResponse , PutImageTagMutabilityRequest , PutImageTagMutabilityResponse , PutLifecyclePolicyRequest , PutLifecyclePolicyResponse , PutRegistryPolicyRequest , PutRegistryPolicyResponse , PutRegistryScanningConfigurationRequest , PutRegistryScanningConfigurationResponse , PutReplicationConfigurationRequest , PutReplicationConfigurationResponse , Recommendation , ReferencedImagesNotFoundException , RegistryPolicyNotFoundException , RegistryScanningConfiguration , RegistryScanningRule , Remediation , ReplicationConfiguration , ReplicationDestination , ReplicationRule , Repository , RepositoryAlreadyExistsException , RepositoryFilter , RepositoryNotEmptyException , RepositoryNotFoundException , RepositoryPolicyNotFoundException , RepositoryScanningConfiguration , RepositoryScanningConfigurationFailure , Resource , ResourceDetails , ScanningRepositoryFilter , ScanNotFoundException , ScoreDetails , ServerException , SetRepositoryPolicyRequest , SetRepositoryPolicyResponse , StartImageScanRequest , StartImageScanResponse , StartLifecyclePolicyPreviewRequest , StartLifecyclePolicyPreviewResponse , Tag , TagResourceRequest , TagResourceResponse , TooManyTagsException , UnsupportedImageTypeException , UnsupportedUpstreamRegistryException , UntagResourceRequest , UntagResourceResponse , UploadLayerPartRequest , UploadLayerPartResponse , UploadNotFoundException , ValidationException , VulnerablePackage , } from "../models/models_0" ; export const serializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.BatchCheckLayerAvailability" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchCheckLayerAvailabilityRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1BatchDeleteImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.BatchDeleteImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchDeleteImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1BatchGetImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.BatchGetImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchGetImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1BatchGetRepositoryScanningConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.BatchGetRepositoryScanningConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1BatchGetRepositoryScanningConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CompleteLayerUploadCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.CompleteLayerUpload" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CompleteLayerUploadRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreatePullThroughCacheRuleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.CreatePullThroughCacheRule" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreatePullThroughCacheRuleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateRepositoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.CreateRepository" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateRepositoryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteLifecyclePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DeleteLifecyclePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteLifecyclePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeletePullThroughCacheRuleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DeletePullThroughCacheRule" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeletePullThroughCacheRuleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteRegistryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DeleteRegistryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteRegistryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteRepositoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DeleteRepository" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteRepositoryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteRepositoryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DeleteRepositoryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteRepositoryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeImageReplicationStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribeImageReplicationStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeImageReplicationStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeImagesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribeImages" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeImagesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeImageScanFindingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribeImageScanFindings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeImageScanFindingsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribePullThroughCacheRulesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribePullThroughCacheRules" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribePullThroughCacheRulesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeRegistryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribeRegistry" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeRegistryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeRepositoriesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.DescribeRepositories" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeRepositoriesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetAuthorizationTokenCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetAuthorizationToken" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetAuthorizationTokenRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetDownloadUrlForLayerCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetDownloadUrlForLayer" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetDownloadUrlForLayerRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLifecyclePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLifecyclePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetLifecyclePolicyPreviewCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetLifecyclePolicyPreview" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetLifecyclePolicyPreviewRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetRegistryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetRegistryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetRegistryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetRegistryScanningConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetRegistryScanningConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetRegistryScanningConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1GetRepositoryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.GetRepositoryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1GetRepositoryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1InitiateLayerUploadCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.InitiateLayerUpload" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1InitiateLayerUploadRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListImagesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.ListImages" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListImagesRequest ( 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" : "AmazonEC2ContainerRegistry_V20150921.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListTagsForResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutImageScanningConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutImageScanningConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutImageScanningConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutImageTagMutabilityCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutImageTagMutability" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutImageTagMutabilityRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutLifecyclePolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutLifecyclePolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutLifecyclePolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutRegistryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutRegistryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutRegistryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutRegistryScanningConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutRegistryScanningConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutRegistryScanningConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1PutReplicationConfigurationCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.PutReplicationConfiguration" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1PutReplicationConfigurationRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1SetRepositoryPolicyCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.SetRepositoryPolicy" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1SetRepositoryPolicyRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartImageScanCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.StartImageScan" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartImageScanRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartLifecyclePolicyPreviewCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.StartLifecyclePolicyPreview" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartLifecyclePolicyPreviewRequest ( 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" : "AmazonEC2ContainerRegistry_V20150921.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" : "AmazonEC2ContainerRegistry_V20150921.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UntagResourceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UploadLayerPartCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "AmazonEC2ContainerRegistry_V20150921.UploadLayerPart" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UploadLayerPartRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1BatchCheckLayerAvailabilityCommand = async ( output , context ) : Promise < BatchCheckLayerAvailabilityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchCheckLayerAvailabilityResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchCheckLayerAvailabilityCommandError = async ( output , context ) : Promise < BatchCheckLayerAvailabilityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1BatchDeleteImageCommand = async ( output , context ) : Promise < BatchDeleteImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchDeleteImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchDeleteImageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchDeleteImageCommandError = async ( output , context ) : Promise < BatchDeleteImageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1BatchGetImageCommand = async ( output , context ) : Promise < BatchGetImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchGetImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchGetImageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchGetImageCommandError = async ( output , context ) : Promise < BatchGetImageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommand = async ( output , context ) : Promise < BatchGetRepositoryScanningConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1BatchGetRepositoryScanningConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1BatchGetRepositoryScanningConfigurationCommandError = async ( output , context ) : Promise < BatchGetRepositoryScanningConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1CompleteLayerUploadCommand = async ( output , context ) : Promise < CompleteLayerUploadCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CompleteLayerUploadCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CompleteLayerUploadResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CompleteLayerUploadCommandError = async ( output , context ) : Promise < CompleteLayerUploadCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "EmptyUploadException" : case "com.amazonaws.ecr#EmptyUploadException" : response = { ... ( await deserializeAws_json1_1EmptyUploadExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidLayerException" : case "com.amazonaws.ecr#InvalidLayerException" : response = { ... ( await deserializeAws_json1_1InvalidLayerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LayerAlreadyExistsException" : case "com.amazonaws.ecr#LayerAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1LayerAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LayerPartTooSmallException" : case "com.amazonaws.ecr#LayerPartTooSmallException" : response = { ... ( await deserializeAws_json1_1LayerPartTooSmallExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UploadNotFoundException" : case "com.amazonaws.ecr#UploadNotFoundException" : response = { ... ( await deserializeAws_json1_1UploadNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreatePullThroughCacheRuleCommand = async ( output , context ) : Promise < CreatePullThroughCacheRuleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreatePullThroughCacheRuleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreatePullThroughCacheRuleResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreatePullThroughCacheRuleCommandError = async ( output , context ) : Promise < CreatePullThroughCacheRuleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.ecr#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PullThroughCacheRuleAlreadyExistsException" : case "com.amazonaws.ecr#PullThroughCacheRuleAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1PullThroughCacheRuleAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUpstreamRegistryException" : case "com.amazonaws.ecr#UnsupportedUpstreamRegistryException" : response = { ... ( await deserializeAws_json1_1UnsupportedUpstreamRegistryExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1CreateRepositoryCommand = async ( output , context ) : Promise < CreateRepositoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateRepositoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateRepositoryResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateRepositoryCommandError = async ( output , context ) : Promise < CreateRepositoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagParameterException" : case "com.amazonaws.ecr#InvalidTagParameterException" : response = { ... ( await deserializeAws_json1_1InvalidTagParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.ecr#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryAlreadyExistsException" : case "com.amazonaws.ecr#RepositoryAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1RepositoryAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTagsException" : case "com.amazonaws.ecr#TooManyTagsException" : response = { ... ( await deserializeAws_json1_1TooManyTagsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteLifecyclePolicyCommand = async ( output , context ) : Promise < DeleteLifecyclePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteLifecyclePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteLifecyclePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteLifecyclePolicyCommandError = async ( output , context ) : Promise < DeleteLifecyclePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LifecyclePolicyNotFoundException" : case "com.amazonaws.ecr#LifecyclePolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1LifecyclePolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeletePullThroughCacheRuleCommand = async ( output , context ) : Promise < DeletePullThroughCacheRuleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeletePullThroughCacheRuleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeletePullThroughCacheRuleResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeletePullThroughCacheRuleCommandError = async ( output , context ) : Promise < DeletePullThroughCacheRuleCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PullThroughCacheRuleNotFoundException" : case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException" : response = { ... ( await deserializeAws_json1_1PullThroughCacheRuleNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DeleteRegistryPolicyCommand = async ( output , context ) : Promise < DeleteRegistryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteRegistryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteRegistryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteRegistryPolicyCommandError = async ( output , context ) : Promise < DeleteRegistryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RegistryPolicyNotFoundException" : case "com.amazonaws.ecr#RegistryPolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1RegistryPolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DeleteRepositoryCommand = async ( output , context ) : Promise < DeleteRepositoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteRepositoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteRepositoryResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteRepositoryCommandError = async ( output , context ) : Promise < DeleteRepositoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotEmptyException" : case "com.amazonaws.ecr#RepositoryNotEmptyException" : response = { ... ( await deserializeAws_json1_1RepositoryNotEmptyExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteRepositoryPolicyCommand = async ( output , context ) : Promise < DeleteRepositoryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteRepositoryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteRepositoryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteRepositoryPolicyCommandError = async ( output , context ) : Promise < DeleteRepositoryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryPolicyNotFoundException" : case "com.amazonaws.ecr#RepositoryPolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryPolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeImageReplicationStatusCommand = async ( output , context ) : Promise < DescribeImageReplicationStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeImageReplicationStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeImageReplicationStatusResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeImageReplicationStatusCommandError = async ( output , context ) : Promise < DescribeImageReplicationStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ImageNotFoundException" : case "com.amazonaws.ecr#ImageNotFoundException" : response = { ... ( await deserializeAws_json1_1ImageNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DescribeImagesCommand = async ( output , context ) : Promise < DescribeImagesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeImagesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeImagesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeImagesCommandError = async ( output , context ) : Promise < DescribeImagesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ImageNotFoundException" : case "com.amazonaws.ecr#ImageNotFoundException" : response = { ... ( await deserializeAws_json1_1ImageNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeImageScanFindingsCommand = async ( output , context ) : Promise < DescribeImageScanFindingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeImageScanFindingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeImageScanFindingsResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeImageScanFindingsCommandError = async ( output , context ) : Promise < DescribeImageScanFindingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ImageNotFoundException" : case "com.amazonaws.ecr#ImageNotFoundException" : response = { ... ( await deserializeAws_json1_1ImageNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ScanNotFoundException" : case "com.amazonaws.ecr#ScanNotFoundException" : response = { ... ( await deserializeAws_json1_1ScanNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DescribePullThroughCacheRulesCommand = async ( output , context ) : Promise < DescribePullThroughCacheRulesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribePullThroughCacheRulesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribePullThroughCacheRulesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribePullThroughCacheRulesCommandError = async ( output , context ) : Promise < DescribePullThroughCacheRulesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PullThroughCacheRuleNotFoundException" : case "com.amazonaws.ecr#PullThroughCacheRuleNotFoundException" : response = { ... ( await deserializeAws_json1_1PullThroughCacheRuleNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DescribeRegistryCommand = async ( output , context ) : Promise < DescribeRegistryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeRegistryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeRegistryResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeRegistryCommandError = async ( output , context ) : Promise < DescribeRegistryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1DescribeRepositoriesCommand = async ( output , context ) : Promise < DescribeRepositoriesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeRepositoriesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeRepositoriesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeRepositoriesCommandError = async ( output , context ) : Promise < DescribeRepositoriesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetAuthorizationTokenCommand = async ( output , context ) : Promise < GetAuthorizationTokenCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetAuthorizationTokenCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetAuthorizationTokenResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetAuthorizationTokenCommandError = async ( output , context ) : Promise < GetAuthorizationTokenCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetDownloadUrlForLayerCommand = async ( output , context ) : Promise < GetDownloadUrlForLayerCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetDownloadUrlForLayerCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetDownloadUrlForLayerResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetDownloadUrlForLayerCommandError = async ( output , context ) : Promise < GetDownloadUrlForLayerCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LayerInaccessibleException" : case "com.amazonaws.ecr#LayerInaccessibleException" : response = { ... ( await deserializeAws_json1_1LayerInaccessibleExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LayersNotFoundException" : case "com.amazonaws.ecr#LayersNotFoundException" : response = { ... ( await deserializeAws_json1_1LayersNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetLifecyclePolicyCommand = async ( output , context ) : Promise < GetLifecyclePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLifecyclePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLifecyclePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLifecyclePolicyCommandError = async ( output , context ) : Promise < GetLifecyclePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LifecyclePolicyNotFoundException" : case "com.amazonaws.ecr#LifecyclePolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1LifecyclePolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetLifecyclePolicyPreviewCommand = async ( output , context ) : Promise < GetLifecyclePolicyPreviewCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetLifecyclePolicyPreviewCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetLifecyclePolicyPreviewResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetLifecyclePolicyPreviewCommandError = async ( output , context ) : Promise < GetLifecyclePolicyPreviewCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LifecyclePolicyPreviewNotFoundException" : case "com.amazonaws.ecr#LifecyclePolicyPreviewNotFoundException" : response = { ... ( await deserializeAws_json1_1LifecyclePolicyPreviewNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1GetRegistryPolicyCommand = async ( output , context ) : Promise < GetRegistryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetRegistryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetRegistryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetRegistryPolicyCommandError = async ( output , context ) : Promise < GetRegistryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RegistryPolicyNotFoundException" : case "com.amazonaws.ecr#RegistryPolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1RegistryPolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1GetRegistryScanningConfigurationCommand = async ( output , context ) : Promise < GetRegistryScanningConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetRegistryScanningConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetRegistryScanningConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetRegistryScanningConfigurationCommandError = async ( output , context ) : Promise < GetRegistryScanningConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1GetRepositoryPolicyCommand = async ( output , context ) : Promise < GetRepositoryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1GetRepositoryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1GetRepositoryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1GetRepositoryPolicyCommandError = async ( output , context ) : Promise < GetRepositoryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryPolicyNotFoundException" : case "com.amazonaws.ecr#RepositoryPolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryPolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1InitiateLayerUploadCommand = async ( output , context ) : Promise < InitiateLayerUploadCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1InitiateLayerUploadCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1InitiateLayerUploadResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1InitiateLayerUploadCommandError = async ( output , context ) : Promise < InitiateLayerUploadCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListImagesCommand = async ( output , context ) : Promise < ListImagesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListImagesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListImagesResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListImagesCommandError = async ( output , context ) : Promise < ListImagesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = 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 "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutImageCommand = async ( output , context ) : Promise < PutImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutImageResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutImageCommandError = async ( output , context ) : Promise < PutImageCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ImageAlreadyExistsException" : case "com.amazonaws.ecr#ImageAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ImageAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ImageDigestDoesNotMatchException" : case "com.amazonaws.ecr#ImageDigestDoesNotMatchException" : response = { ... ( await deserializeAws_json1_1ImageDigestDoesNotMatchExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ImageTagAlreadyExistsException" : case "com.amazonaws.ecr#ImageTagAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ImageTagAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LayersNotFoundException" : case "com.amazonaws.ecr#LayersNotFoundException" : response = { ... ( await deserializeAws_json1_1LayersNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.ecr#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ReferencedImagesNotFoundException" : case "com.amazonaws.ecr#ReferencedImagesNotFoundException" : response = { ... ( await deserializeAws_json1_1ReferencedImagesNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutImageScanningConfigurationCommand = async ( output , context ) : Promise < PutImageScanningConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutImageScanningConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutImageScanningConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutImageScanningConfigurationCommandError = async ( output , context ) : Promise < PutImageScanningConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1PutImageTagMutabilityCommand = async ( output , context ) : Promise < PutImageTagMutabilityCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutImageTagMutabilityCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutImageTagMutabilityResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutImageTagMutabilityCommandError = async ( output , context ) : Promise < PutImageTagMutabilityCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutLifecyclePolicyCommand = async ( output , context ) : Promise < PutLifecyclePolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutLifecyclePolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutLifecyclePolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutLifecyclePolicyCommandError = async ( output , context ) : Promise < PutLifecyclePolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1PutRegistryPolicyCommand = async ( output , context ) : Promise < PutRegistryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutRegistryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutRegistryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutRegistryPolicyCommandError = async ( output , context ) : Promise < PutRegistryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1PutRegistryScanningConfigurationCommand = async ( output , context ) : Promise < PutRegistryScanningConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutRegistryScanningConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutRegistryScanningConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutRegistryScanningConfigurationCommandError = async ( output , context ) : Promise < PutRegistryScanningConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1PutReplicationConfigurationCommand = async ( output , context ) : Promise < PutReplicationConfigurationCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1PutReplicationConfigurationCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1PutReplicationConfigurationResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1PutReplicationConfigurationCommandError = async ( output , context ) : Promise < PutReplicationConfigurationCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1SetRepositoryPolicyCommand = async ( output , context ) : Promise < SetRepositoryPolicyCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1SetRepositoryPolicyCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1SetRepositoryPolicyResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1SetRepositoryPolicyCommandError = async ( output , context ) : Promise < SetRepositoryPolicyCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartImageScanCommand = async ( output , context ) : Promise < StartImageScanCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartImageScanCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartImageScanResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartImageScanCommandError = async ( output , context ) : Promise < StartImageScanCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ImageNotFoundException" : case "com.amazonaws.ecr#ImageNotFoundException" : response = { ... ( await deserializeAws_json1_1ImageNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.ecr#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedImageTypeException" : case "com.amazonaws.ecr#UnsupportedImageTypeException" : response = { ... ( await deserializeAws_json1_1UnsupportedImageTypeExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.ecr#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_1StartLifecyclePolicyPreviewCommand = async ( output , context ) : Promise < StartLifecyclePolicyPreviewCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartLifecyclePolicyPreviewCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartLifecyclePolicyPreviewResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartLifecyclePolicyPreviewCommandError = async ( output , context ) : Promise < StartLifecyclePolicyPreviewCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LifecyclePolicyNotFoundException" : case "com.amazonaws.ecr#LifecyclePolicyNotFoundException" : response = { ... ( await deserializeAws_json1_1LifecyclePolicyNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LifecyclePolicyPreviewInProgressException" : case "com.amazonaws.ecr#LifecyclePolicyPreviewInProgressException" : response = { ... ( await deserializeAws_json1_1LifecyclePolicyPreviewInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = 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 "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagParameterException" : case "com.amazonaws.ecr#InvalidTagParameterException" : response = { ... ( await deserializeAws_json1_1InvalidTagParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTagsException" : case "com.amazonaws.ecr#TooManyTagsException" : response = { ... ( await deserializeAws_json1_1TooManyTagsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = 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 "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidTagParameterException" : case "com.amazonaws.ecr#InvalidTagParameterException" : response = { ... ( await deserializeAws_json1_1InvalidTagParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "TooManyTagsException" : case "com.amazonaws.ecr#TooManyTagsException" : response = { ... ( await deserializeAws_json1_1TooManyTagsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UploadLayerPartCommand = async ( output , context ) : Promise < UploadLayerPartCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UploadLayerPartCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UploadLayerPartResponse ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UploadLayerPartCommandError = async ( output , context ) : Promise < UploadLayerPartCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidLayerPartException" : case "com.amazonaws.ecr#InvalidLayerPartException" : response = { ... ( await deserializeAws_json1_1InvalidLayerPartExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterException" : case "com.amazonaws.ecr#InvalidParameterException" : response = { ... ( await deserializeAws_json1_1InvalidParameterExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "KmsException" : case "com.amazonaws.ecr#KmsException" : response = { ... ( await deserializeAws_json1_1KmsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.ecr#LimitExceededException" : response = { ... ( await deserializeAws_json1_1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "RepositoryNotFoundException" : case "com.amazonaws.ecr#RepositoryNotFoundException" : response = { ... ( await deserializeAws_json1_1RepositoryNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServerException" : case "com.amazonaws.ecr#ServerException" : response = { ... ( await deserializeAws_json1_1ServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UploadNotFoundException" : case "com.amazonaws.ecr#UploadNotFoundException" : response = { ... ( await deserializeAws_json1_1UploadNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } 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_1EmptyUploadExceptionResponse = async ( parsedOutput , context ) : Promise < EmptyUploadException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1EmptyUploadException ( body , context ) ; const contents = { name : "EmptyUploadException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ImageAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < ImageAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ImageAlreadyExistsException ( body , context ) ; const contents = { name : "ImageAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ImageDigestDoesNotMatchExceptionResponse = async ( parsedOutput , context ) : Promise < ImageDigestDoesNotMatchException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ImageDigestDoesNotMatchException ( body , context ) ; const contents = { name : "ImageDigestDoesNotMatchException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ImageNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ImageNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ImageNotFoundException ( body , context ) ; const contents = { name : "ImageNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ImageTagAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < ImageTagAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ImageTagAlreadyExistsException ( body , context ) ; const contents = { name : "ImageTagAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidLayerExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidLayerException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidLayerException ( body , context ) ; const contents = { name : "InvalidLayerException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidLayerPartExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidLayerPartException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidLayerPartException ( body , context ) ; const contents = { name : "InvalidLayerPartException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterException ( body , context ) ; const contents = { name : "InvalidParameterException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidTagParameterExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidTagParameterException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidTagParameterException ( body , context ) ; const contents = { name : "InvalidTagParameterException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1KmsExceptionResponse = async ( parsedOutput , context ) : Promise < KmsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1KmsException ( body , context ) ; const contents = { name : "KmsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LayerAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < LayerAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LayerAlreadyExistsException ( body , context ) ; const contents = { name : "LayerAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LayerInaccessibleExceptionResponse = async ( parsedOutput , context ) : Promise < LayerInaccessibleException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LayerInaccessibleException ( body , context ) ; const contents = { name : "LayerInaccessibleException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LayerPartTooSmallExceptionResponse = async ( parsedOutput , context ) : Promise < LayerPartTooSmallException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LayerPartTooSmallException ( body , context ) ; const contents = { name : "LayerPartTooSmallException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LayersNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < LayersNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LayersNotFoundException ( body , context ) ; const contents = { name : "LayersNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LifecyclePolicyNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < LifecyclePolicyNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LifecyclePolicyNotFoundException ( body , context ) ; const contents = { name : "LifecyclePolicyNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewInProgressExceptionResponse = async ( parsedOutput , context ) : Promise < LifecyclePolicyPreviewInProgressException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LifecyclePolicyPreviewInProgressException ( body , context ) ; const contents = { name : "LifecyclePolicyPreviewInProgressException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < LifecyclePolicyPreviewNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LifecyclePolicyPreviewNotFoundException ( body , context ) ; const contents = { name : "LifecyclePolicyPreviewNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1LimitExceededException ( body , context ) ; const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1PullThroughCacheRuleAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < PullThroughCacheRuleAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1PullThroughCacheRuleAlreadyExistsException ( body , context ) ; const contents = { name : "PullThroughCacheRuleAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1PullThroughCacheRuleNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < PullThroughCacheRuleNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1PullThroughCacheRuleNotFoundException ( body , context ) ; const contents = { name : "PullThroughCacheRuleNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ReferencedImagesNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ReferencedImagesNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ReferencedImagesNotFoundException ( body , context ) ; const contents = { name : "ReferencedImagesNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RegistryPolicyNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < RegistryPolicyNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RegistryPolicyNotFoundException ( body , context ) ; const contents = { name : "RegistryPolicyNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RepositoryAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < RepositoryAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RepositoryAlreadyExistsException ( body , context ) ; const contents = { name : "RepositoryAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RepositoryNotEmptyExceptionResponse = async ( parsedOutput , context ) : Promise < RepositoryNotEmptyException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RepositoryNotEmptyException ( body , context ) ; const contents = { name : "RepositoryNotEmptyException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RepositoryNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < RepositoryNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RepositoryNotFoundException ( body , context ) ; const contents = { name : "RepositoryNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1RepositoryPolicyNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < RepositoryPolicyNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1RepositoryPolicyNotFoundException ( body , context ) ; const contents = { name : "RepositoryPolicyNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ScanNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ScanNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ScanNotFoundException ( body , context ) ; const contents = { name : "ScanNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ServerExceptionResponse = async ( parsedOutput , context ) : Promise < ServerException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ServerException ( body , context ) ; const contents = { name : "ServerException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1TooManyTagsExceptionResponse = async ( parsedOutput , context ) : Promise < TooManyTagsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1TooManyTagsException ( body , context ) ; const contents = { name : "TooManyTagsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedImageTypeExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedImageTypeException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedImageTypeException ( body , context ) ; const contents = { name : "UnsupportedImageTypeException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedUpstreamRegistryExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedUpstreamRegistryException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedUpstreamRegistryException ( body , context ) ; const contents = { name : "UnsupportedUpstreamRegistryException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UploadNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < UploadNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UploadNotFoundException ( body , context ) ; const contents = { name : "UploadNotFoundException" , $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_1BatchCheckLayerAvailabilityRequest = ( input , context ) : any => { return { ... ( input . layerDigests !== undefined && input . layerDigests !== null && { layerDigests : serializeAws_json1_1BatchedOperationLayerDigestList ( input . layerDigests , context ) , } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1BatchDeleteImageRequest = ( input , context ) : any => { return { ... ( input . imageIds !== undefined && input . imageIds !== null && { imageIds : serializeAws_json1_1ImageIdentifierList ( input . imageIds , context ) } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1BatchedOperationLayerDigestList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1BatchGetImageRequest = ( input , context ) : any => { return { ... ( input . acceptedMediaTypes !== undefined && input . acceptedMediaTypes !== null && { acceptedMediaTypes : serializeAws_json1_1MediaTypeList ( input . acceptedMediaTypes , context ) , } ) , ... ( input . imageIds !== undefined && input . imageIds !== null && { imageIds : serializeAws_json1_1ImageIdentifierList ( input . imageIds , context ) } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1BatchGetRepositoryScanningConfigurationRequest = ( input , context ) : any => { return { ... ( input . repositoryNames !== undefined && input . repositoryNames !== null && { repositoryNames : serializeAws_json1_1ScanningConfigurationRepositoryNameList ( input . repositoryNames , context ) , } ) , } ; } ; const serializeAws_json1_1CompleteLayerUploadRequest = ( input , context ) : any => { return { ... ( input . layerDigests !== undefined && input . layerDigests !== null && { layerDigests : serializeAws_json1_1LayerDigestList ( input . layerDigests , context ) , } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . uploadId !== undefined && input . uploadId !== null && { uploadId : input . uploadId } ) , } ; } ; const serializeAws_json1_1CreatePullThroughCacheRuleRequest = ( input , context ) : any => { return { ... ( input . ecrRepositoryPrefix !== undefined && input . ecrRepositoryPrefix !== null && { ecrRepositoryPrefix : input . ecrRepositoryPrefix } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . upstreamRegistryUrl !== undefined && input . upstreamRegistryUrl !== null && { upstreamRegistryUrl : input . upstreamRegistryUrl } ) , } ; } ; const serializeAws_json1_1CreateRepositoryRequest = ( input , context ) : any => { return { ... ( input . encryptionConfiguration !== undefined && input . encryptionConfiguration !== null && { encryptionConfiguration : serializeAws_json1_1EncryptionConfiguration ( input . encryptionConfiguration , context ) , } ) , ... ( input . imageScanningConfiguration !== undefined && input . imageScanningConfiguration !== null && { imageScanningConfiguration : serializeAws_json1_1ImageScanningConfiguration ( input . imageScanningConfiguration , context ) , } ) , ... ( input . imageTagMutability !== undefined && input . imageTagMutability !== null && { imageTagMutability : input . imageTagMutability } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_1TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_1DeleteLifecyclePolicyRequest = ( input , context ) : any => { return { ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DeletePullThroughCacheRuleRequest = ( input , context ) : any => { return { ... ( input . ecrRepositoryPrefix !== undefined && input . ecrRepositoryPrefix !== null && { ecrRepositoryPrefix : input . ecrRepositoryPrefix } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , } ; } ; const serializeAws_json1_1DeleteRegistryPolicyRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1DeleteRepositoryPolicyRequest = ( input , context ) : any => { return { ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DeleteRepositoryRequest = ( input , context ) : any => { return { ... ( input . force !== undefined && input . force !== null && { force : input . force } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DescribeImageReplicationStatusRequest = ( input , context ) : any => { return { ... ( input . imageId !== undefined && input . imageId !== null && { imageId : serializeAws_json1_1ImageIdentifier ( input . imageId , context ) } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DescribeImageScanFindingsRequest = ( input , context ) : any => { return { ... ( input . imageId !== undefined && input . imageId !== null && { imageId : serializeAws_json1_1ImageIdentifier ( input . imageId , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DescribeImagesFilter = ( input , context ) : any => { return { ... ( input . tagStatus !== undefined && input . tagStatus !== null && { tagStatus : input . tagStatus } ) , } ; } ; const serializeAws_json1_1DescribeImagesRequest = ( input , context ) : any => { return { ... ( input . filter !== undefined && input . filter !== null && { filter : serializeAws_json1_1DescribeImagesFilter ( input . filter , context ) } ) , ... ( input . imageIds !== undefined && input . imageIds !== null && { imageIds : serializeAws_json1_1ImageIdentifierList ( input . imageIds , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1DescribePullThroughCacheRulesRequest = ( input , context ) : any => { return { ... ( input . ecrRepositoryPrefixes !== undefined && input . ecrRepositoryPrefixes !== null && { ecrRepositoryPrefixes : serializeAws_json1_1PullThroughCacheRuleRepositoryPrefixList ( input . ecrRepositoryPrefixes , context ) , } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , } ; } ; const serializeAws_json1_1DescribeRegistryRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1DescribeRepositoriesRequest = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryNames !== undefined && input . repositoryNames !== null && { repositoryNames : serializeAws_json1_1RepositoryNameList ( input . repositoryNames , context ) , } ) , } ; } ; const serializeAws_json1_1EncryptionConfiguration = ( input , context ) : any => { return { ... ( input . encryptionType !== undefined && input . encryptionType !== null && { encryptionType : input . encryptionType } ) , ... ( input . kmsKey !== undefined && input . kmsKey !== null && { kmsKey : input . kmsKey } ) , } ; } ; const serializeAws_json1_1GetAuthorizationTokenRegistryIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1GetAuthorizationTokenRequest = ( input , context ) : any => { return { ... ( input . registryIds !== undefined && input . registryIds !== null && { registryIds : serializeAws_json1_1GetAuthorizationTokenRegistryIdList ( input . registryIds , context ) , } ) , } ; } ; const serializeAws_json1_1GetDownloadUrlForLayerRequest = ( input , context ) : any => { return { ... ( input . layerDigest !== undefined && input . layerDigest !== null && { layerDigest : input . layerDigest } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1GetLifecyclePolicyPreviewRequest = ( input , context ) : any => { return { ... ( input . filter !== undefined && input . filter !== null && { filter : serializeAws_json1_1LifecyclePolicyPreviewFilter ( input . filter , context ) } ) , ... ( input . imageIds !== undefined && input . imageIds !== null && { imageIds : serializeAws_json1_1ImageIdentifierList ( input . imageIds , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1GetLifecyclePolicyRequest = ( input , context ) : any => { return { ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1GetRegistryPolicyRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1GetRegistryScanningConfigurationRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1GetRepositoryPolicyRequest = ( input , context ) : any => { return { ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1ImageIdentifier = ( input , context ) : any => { return { ... ( input . imageDigest !== undefined && input . imageDigest !== null && { imageDigest : input . imageDigest } ) , ... ( input . imageTag !== undefined && input . imageTag !== null && { imageTag : input . imageTag } ) , } ; } ; const serializeAws_json1_1ImageIdentifierList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ImageIdentifier ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ImageScanningConfiguration = ( input , context ) : any => { return { ... ( input . scanOnPush !== undefined && input . scanOnPush !== null && { scanOnPush : input . scanOnPush } ) , } ; } ; const serializeAws_json1_1InitiateLayerUploadRequest = ( input , context ) : any => { return { ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1LayerDigestList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1LifecyclePolicyPreviewFilter = ( input , context ) : any => { return { ... ( input . tagStatus !== undefined && input . tagStatus !== null && { tagStatus : input . tagStatus } ) , } ; } ; const serializeAws_json1_1ListImagesFilter = ( input , context ) : any => { return { ... ( input . tagStatus !== undefined && input . tagStatus !== null && { tagStatus : input . tagStatus } ) , } ; } ; const serializeAws_json1_1ListImagesRequest = ( input , context ) : any => { return { ... ( input . filter !== undefined && input . filter !== null && { filter : serializeAws_json1_1ListImagesFilter ( input . filter , context ) } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1ListTagsForResourceRequest = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , } ; } ; const serializeAws_json1_1MediaTypeList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PullThroughCacheRuleRepositoryPrefixList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1PutImageRequest = ( input , context ) : any => { return { ... ( input . imageDigest !== undefined && input . imageDigest !== null && { imageDigest : input . imageDigest } ) , ... ( input . imageManifest !== undefined && input . imageManifest !== null && { imageManifest : input . imageManifest } ) , ... ( input . imageManifestMediaType !== undefined && input . imageManifestMediaType !== null && { imageManifestMediaType : input . imageManifestMediaType } ) , ... ( input . imageTag !== undefined && input . imageTag !== null && { imageTag : input . imageTag } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1PutImageScanningConfigurationRequest = ( input , context ) : any => { return { ... ( input . imageScanningConfiguration !== undefined && input . imageScanningConfiguration !== null && { imageScanningConfiguration : serializeAws_json1_1ImageScanningConfiguration ( input . imageScanningConfiguration , context ) , } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1PutImageTagMutabilityRequest = ( input , context ) : any => { return { ... ( input . imageTagMutability !== undefined && input . imageTagMutability !== null && { imageTagMutability : input . imageTagMutability } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1PutLifecyclePolicyRequest = ( input , context ) : any => { return { ... ( input . lifecyclePolicyText !== undefined && input . lifecyclePolicyText !== null && { lifecyclePolicyText : input . lifecyclePolicyText } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1PutRegistryPolicyRequest = ( input , context ) : any => { return { ... ( input . policyText !== undefined && input . policyText !== null && { policyText : input . policyText } ) , } ; } ; const serializeAws_json1_1PutRegistryScanningConfigurationRequest = ( input , context ) : any => { return { ... ( input . rules !== undefined && input . rules !== null && { rules : serializeAws_json1_1RegistryScanningRuleList ( input . rules , context ) } ) , ... ( input . scanType !== undefined && input . scanType !== null && { scanType : input . scanType } ) , } ; } ; const serializeAws_json1_1PutReplicationConfigurationRequest = ( input , context ) : any => { return { ... ( input . replicationConfiguration !== undefined && input . replicationConfiguration !== null && { replicationConfiguration : serializeAws_json1_1ReplicationConfiguration ( input . replicationConfiguration , context ) , } ) , } ; } ; const serializeAws_json1_1RegistryScanningRule = ( input , context ) : any => { return { ... ( input . repositoryFilters !== undefined && input . repositoryFilters !== null && { repositoryFilters : serializeAws_json1_1ScanningRepositoryFilterList ( input . repositoryFilters , context ) , } ) , ... ( input . scanFrequency !== undefined && input . scanFrequency !== null && { scanFrequency : input . scanFrequency } ) , } ; } ; const serializeAws_json1_1RegistryScanningRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1RegistryScanningRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ReplicationConfiguration = ( input , context ) : any => { return { ... ( input . rules !== undefined && input . rules !== null && { rules : serializeAws_json1_1ReplicationRuleList ( input . rules , context ) } ) , } ; } ; const serializeAws_json1_1ReplicationDestination = ( input , context ) : any => { return { ... ( input . region !== undefined && input . region !== null && { region : input . region } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , } ; } ; const serializeAws_json1_1ReplicationDestinationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ReplicationDestination ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ReplicationRule = ( input , context ) : any => { return { ... ( input . destinations !== undefined && input . destinations !== null && { destinations : serializeAws_json1_1ReplicationDestinationList ( input . destinations , context ) , } ) , ... ( input . repositoryFilters !== undefined && input . repositoryFilters !== null && { repositoryFilters : serializeAws_json1_1RepositoryFilterList ( input . repositoryFilters , context ) , } ) , } ; } ; const serializeAws_json1_1ReplicationRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ReplicationRule ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RepositoryFilter = ( input , context ) : any => { return { ... ( input . filter !== undefined && input . filter !== null && { filter : input . filter } ) , ... ( input . filterType !== undefined && input . filterType !== null && { filterType : input . filterType } ) , } ; } ; const serializeAws_json1_1RepositoryFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1RepositoryFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RepositoryNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ScanningConfigurationRepositoryNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ScanningRepositoryFilter = ( input , context ) : any => { return { ... ( input . filter !== undefined && input . filter !== null && { filter : input . filter } ) , ... ( input . filterType !== undefined && input . filterType !== null && { filterType : input . filterType } ) , } ; } ; const serializeAws_json1_1ScanningRepositoryFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1ScanningRepositoryFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_1SetRepositoryPolicyRequest = ( input , context ) : any => { return { ... ( input . force !== undefined && input . force !== null && { force : input . force } ) , ... ( input . policyText !== undefined && input . policyText !== null && { policyText : input . policyText } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1StartImageScanRequest = ( input , context ) : any => { return { ... ( input . imageId !== undefined && input . imageId !== null && { imageId : serializeAws_json1_1ImageIdentifier ( input . imageId , context ) } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; const serializeAws_json1_1StartLifecyclePolicyPreviewRequest = ( input , context ) : any => { return { ... ( input . lifecyclePolicyText !== undefined && input . lifecyclePolicyText !== null && { lifecyclePolicyText : input . lifecyclePolicyText } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , } ; } ; 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_1UploadLayerPartRequest = ( input , context ) : any => { return { ... ( input . layerPartBlob !== undefined && input . layerPartBlob !== null && { layerPartBlob : context . base64Encoder ( input . layerPartBlob ) } ) , ... ( input . partFirstByte !== undefined && input . partFirstByte !== null && { partFirstByte : input . partFirstByte } ) , ... ( input . partLastByte !== undefined && input . partLastByte !== null && { partLastByte : input . partLastByte } ) , ... ( input . registryId !== undefined && input . registryId !== null && { registryId : input . registryId } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . uploadId !== undefined && input . uploadId !== null && { uploadId : input . uploadId } ) , } ; } ; const deserializeAws_json1_1Attribute = ( output , context ) : Attribute => { return { key : __expectString ( output . key ) , value : __expectString ( output . value ) , } as any ; } ; const deserializeAws_json1_1AttributeList = ( output , context ) : Attribute [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Attribute ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AuthorizationData = ( output , context ) : AuthorizationData => { return { authorizationToken : __expectString ( output . authorizationToken ) , expiresAt : output . expiresAt !== undefined && output . expiresAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . expiresAt ) ) ) : undefined , proxyEndpoint : __expectString ( output . proxyEndpoint ) , } as any ; } ; const deserializeAws_json1_1AuthorizationDataList = ( output , context ) : AuthorizationData [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AuthorizationData ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AwsEcrContainerImageDetails = ( output , context ) : AwsEcrContainerImageDetails => { return { architecture : __expectString ( output . architecture ) , author : __expectString ( output . author ) , imageHash : __expectString ( output . imageHash ) , imageTags : output . imageTags !== undefined && output . imageTags !== null ? deserializeAws_json1_1ImageTagsList ( output . imageTags , context ) : undefined , platform : __expectString ( output . platform ) , pushedAt : output . pushedAt !== undefined && output . pushedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . pushedAt ) ) ) : undefined , registry : __expectString ( output . registry ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1BatchCheckLayerAvailabilityResponse = ( output , context ) : BatchCheckLayerAvailabilityResponse => { return { failures : output . failures !== undefined && output . failures !== null ? deserializeAws_json1_1LayerFailureList ( output . failures , context ) : undefined , layers : output . layers !== undefined && output . layers !== null ? deserializeAws_json1_1LayerList ( output . layers , context ) : undefined , } as any ; } ; const deserializeAws_json1_1BatchDeleteImageResponse = ( output , context ) : BatchDeleteImageResponse => { return { failures : output . failures !== undefined && output . failures !== null ? deserializeAws_json1_1ImageFailureList ( output . failures , context ) : undefined , imageIds : output . imageIds !== undefined && output . imageIds !== null ? deserializeAws_json1_1ImageIdentifierList ( output . imageIds , context ) : undefined , } as any ; } ; const deserializeAws_json1_1BatchGetImageResponse = ( output , context ) : BatchGetImageResponse => { return { failures : output . failures !== undefined && output . failures !== null ? deserializeAws_json1_1ImageFailureList ( output . failures , context ) : undefined , images : output . images !== undefined && output . images !== null ? deserializeAws_json1_1ImageList ( output . images , context ) : undefined , } as any ; } ; const deserializeAws_json1_1BatchGetRepositoryScanningConfigurationResponse = ( output , context ) : BatchGetRepositoryScanningConfigurationResponse => { return { failures : output . failures !== undefined && output . failures !== null ? deserializeAws_json1_1RepositoryScanningConfigurationFailureList ( output . failures , context ) : undefined , scanningConfigurations : output . scanningConfigurations !== undefined && output . scanningConfigurations !== null ? deserializeAws_json1_1RepositoryScanningConfigurationList ( output . scanningConfigurations , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CompleteLayerUploadResponse = ( output , context ) : CompleteLayerUploadResponse => { return { layerDigest : __expectString ( output . layerDigest ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , uploadId : __expectString ( output . uploadId ) , } as any ; } ; const deserializeAws_json1_1CreatePullThroughCacheRuleResponse = ( output , context ) : CreatePullThroughCacheRuleResponse => { return { createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , ecrRepositoryPrefix : __expectString ( output . ecrRepositoryPrefix ) , registryId : __expectString ( output . registryId ) , upstreamRegistryUrl : __expectString ( output . upstreamRegistryUrl ) , } as any ; } ; const deserializeAws_json1_1CreateRepositoryResponse = ( output , context ) : CreateRepositoryResponse => { return { repository : output . repository !== undefined && output . repository !== null ? deserializeAws_json1_1Repository ( output . repository , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CvssScore = ( output , context ) : CvssScore => { return { baseScore : __limitedParseDouble ( output . baseScore ) , scoringVector : __expectString ( output . scoringVector ) , source : __expectString ( output . source ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_json1_1CvssScoreAdjustment = ( output , context ) : CvssScoreAdjustment => { return { metric : __expectString ( output . metric ) , reason : __expectString ( output . reason ) , } as any ; } ; const deserializeAws_json1_1CvssScoreAdjustmentList = ( output , context ) : CvssScoreAdjustment [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CvssScoreAdjustment ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CvssScoreDetails = ( output , context ) : CvssScoreDetails => { return { adjustments : output . adjustments !== undefined && output . adjustments !== null ? deserializeAws_json1_1CvssScoreAdjustmentList ( output . adjustments , context ) : undefined , score : __limitedParseDouble ( output . score ) , scoreSource : __expectString ( output . scoreSource ) , scoringVector : __expectString ( output . scoringVector ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_json1_1CvssScoreList = ( output , context ) : CvssScore [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1CvssScore ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DeleteLifecyclePolicyResponse = ( output , context ) : DeleteLifecyclePolicyResponse => { return { lastEvaluatedAt : output . lastEvaluatedAt !== undefined && output . lastEvaluatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastEvaluatedAt ) ) ) : undefined , lifecyclePolicyText : __expectString ( output . lifecyclePolicyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1DeletePullThroughCacheRuleResponse = ( output , context ) : DeletePullThroughCacheRuleResponse => { return { createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , ecrRepositoryPrefix : __expectString ( output . ecrRepositoryPrefix ) , registryId : __expectString ( output . registryId ) , upstreamRegistryUrl : __expectString ( output . upstreamRegistryUrl ) , } as any ; } ; const deserializeAws_json1_1DeleteRegistryPolicyResponse = ( output , context ) : DeleteRegistryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , } as any ; } ; const deserializeAws_json1_1DeleteRepositoryPolicyResponse = ( output , context ) : DeleteRepositoryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1DeleteRepositoryResponse = ( output , context ) : DeleteRepositoryResponse => { return { repository : output . repository !== undefined && output . repository !== null ? deserializeAws_json1_1Repository ( output . repository , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeImageReplicationStatusResponse = ( output , context ) : DescribeImageReplicationStatusResponse => { return { imageId : output . imageId !== undefined && output . imageId !== null ? deserializeAws_json1_1ImageIdentifier ( output . imageId , context ) : undefined , replicationStatuses : output . replicationStatuses !== undefined && output . replicationStatuses !== null ? deserializeAws_json1_1ImageReplicationStatusList ( output . replicationStatuses , context ) : undefined , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1DescribeImageScanFindingsResponse = ( output , context ) : DescribeImageScanFindingsResponse => { return { imageId : output . imageId !== undefined && output . imageId !== null ? deserializeAws_json1_1ImageIdentifier ( output . imageId , context ) : undefined , imageScanFindings : output . imageScanFindings !== undefined && output . imageScanFindings !== null ? deserializeAws_json1_1ImageScanFindings ( output . imageScanFindings , context ) : undefined , imageScanStatus : output . imageScanStatus !== undefined && output . imageScanStatus !== null ? deserializeAws_json1_1ImageScanStatus ( output . imageScanStatus , context ) : undefined , nextToken : __expectString ( output . nextToken ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1DescribeImagesResponse = ( output , context ) : DescribeImagesResponse => { return { imageDetails : output . imageDetails !== undefined && output . imageDetails !== null ? deserializeAws_json1_1ImageDetailList ( output . imageDetails , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_1DescribePullThroughCacheRulesResponse = ( output , context ) : DescribePullThroughCacheRulesResponse => { return { nextToken : __expectString ( output . nextToken ) , pullThroughCacheRules : output . pullThroughCacheRules !== undefined && output . pullThroughCacheRules !== null ? deserializeAws_json1_1PullThroughCacheRuleList ( output . pullThroughCacheRules , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeRegistryResponse = ( output , context ) : DescribeRegistryResponse => { return { registryId : __expectString ( output . registryId ) , replicationConfiguration : output . replicationConfiguration !== undefined && output . replicationConfiguration !== null ? deserializeAws_json1_1ReplicationConfiguration ( output . replicationConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeRepositoriesResponse = ( output , context ) : DescribeRepositoriesResponse => { return { nextToken : __expectString ( output . nextToken ) , repositories : output . repositories !== undefined && output . repositories !== null ? deserializeAws_json1_1RepositoryList ( output . repositories , context ) : undefined , } as any ; } ; const deserializeAws_json1_1EmptyUploadException = ( output , context ) : EmptyUploadException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1EncryptionConfiguration = ( output , context ) : EncryptionConfiguration => { return { encryptionType : __expectString ( output . encryptionType ) , kmsKey : __expectString ( output . kmsKey ) , } as any ; } ; const deserializeAws_json1_1EnhancedImageScanFinding = ( output , context ) : EnhancedImageScanFinding => { return { awsAccountId : __expectString ( output . awsAccountId ) , description : __expectString ( output . description ) , findingArn : __expectString ( output . findingArn ) , firstObservedAt : output . firstObservedAt !== undefined && output . firstObservedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . firstObservedAt ) ) ) : undefined , lastObservedAt : output . lastObservedAt !== undefined && output . lastObservedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastObservedAt ) ) ) : undefined , packageVulnerabilityDetails : output . packageVulnerabilityDetails !== undefined && output . packageVulnerabilityDetails !== null ? deserializeAws_json1_1PackageVulnerabilityDetails ( output . packageVulnerabilityDetails , context ) : undefined , remediation : output . remediation !== undefined && output . remediation !== null ? deserializeAws_json1_1Remediation ( output . remediation , context ) : undefined , resources : output . resources !== undefined && output . resources !== null ? deserializeAws_json1_1ResourceList ( output . resources , context ) : undefined , score : __limitedParseDouble ( output . score ) , scoreDetails : output . scoreDetails !== undefined && output . scoreDetails !== null ? deserializeAws_json1_1ScoreDetails ( output . scoreDetails , context ) : undefined , severity : __expectString ( output . severity ) , status : __expectString ( output . status ) , title : __expectString ( output . title ) , type : __expectString ( output . type ) , updatedAt : output . updatedAt !== undefined && output . updatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . updatedAt ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1EnhancedImageScanFindingList = ( output , context ) : EnhancedImageScanFinding [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1EnhancedImageScanFinding ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FindingSeverityCounts = ( output , context ) : { [ key ] : number ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectInt32 ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1GetAuthorizationTokenResponse = ( output , context ) : GetAuthorizationTokenResponse => { return { authorizationData : output . authorizationData !== undefined && output . authorizationData !== null ? deserializeAws_json1_1AuthorizationDataList ( output . authorizationData , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetDownloadUrlForLayerResponse = ( output , context ) : GetDownloadUrlForLayerResponse => { return { downloadUrl : __expectString ( output . downloadUrl ) , layerDigest : __expectString ( output . layerDigest ) , } as any ; } ; const deserializeAws_json1_1GetLifecyclePolicyPreviewResponse = ( output , context ) : GetLifecyclePolicyPreviewResponse => { return { lifecyclePolicyText : __expectString ( output . lifecyclePolicyText ) , nextToken : __expectString ( output . nextToken ) , previewResults : output . previewResults !== undefined && output . previewResults !== null ? deserializeAws_json1_1LifecyclePolicyPreviewResultList ( output . previewResults , context ) : undefined , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , status : __expectString ( output . status ) , summary : output . summary !== undefined && output . summary !== null ? deserializeAws_json1_1LifecyclePolicyPreviewSummary ( output . summary , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetLifecyclePolicyResponse = ( output , context ) : GetLifecyclePolicyResponse => { return { lastEvaluatedAt : output . lastEvaluatedAt !== undefined && output . lastEvaluatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastEvaluatedAt ) ) ) : undefined , lifecyclePolicyText : __expectString ( output . lifecyclePolicyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1GetRegistryPolicyResponse = ( output , context ) : GetRegistryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , } as any ; } ; const deserializeAws_json1_1GetRegistryScanningConfigurationResponse = ( output , context ) : GetRegistryScanningConfigurationResponse => { return { registryId : __expectString ( output . registryId ) , scanningConfiguration : output . scanningConfiguration !== undefined && output . scanningConfiguration !== null ? deserializeAws_json1_1RegistryScanningConfiguration ( output . scanningConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1GetRepositoryPolicyResponse = ( output , context ) : GetRepositoryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1Image = ( output , context ) : Image => { return { imageId : output . imageId !== undefined && output . imageId !== null ? deserializeAws_json1_1ImageIdentifier ( output . imageId , context ) : undefined , imageManifest : __expectString ( output . imageManifest ) , imageManifestMediaType : __expectString ( output . imageManifestMediaType ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1ImageAlreadyExistsException = ( output , context ) : ImageAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ImageDetail = ( output , context ) : ImageDetail => { return { artifactMediaType : __expectString ( output . artifactMediaType ) , imageDigest : __expectString ( output . imageDigest ) , imageManifestMediaType : __expectString ( output . imageManifestMediaType ) , imagePushedAt : output . imagePushedAt !== undefined && output . imagePushedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . imagePushedAt ) ) ) : undefined , imageScanFindingsSummary : output . imageScanFindingsSummary !== undefined && output . imageScanFindingsSummary !== null ? deserializeAws_json1_1ImageScanFindingsSummary ( output . imageScanFindingsSummary , context ) : undefined , imageScanStatus : output . imageScanStatus !== undefined && output . imageScanStatus !== null ? deserializeAws_json1_1ImageScanStatus ( output . imageScanStatus , context ) : undefined , imageSizeInBytes : __expectLong ( output . imageSizeInBytes ) , imageTags : output . imageTags !== undefined && output . imageTags !== null ? deserializeAws_json1_1ImageTagList ( output . imageTags , context ) : undefined , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1ImageDetailList = ( output , context ) : ImageDetail [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImageDetail ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageDigestDoesNotMatchException = ( output , context ) : ImageDigestDoesNotMatchException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ImageFailure = ( output , context ) : ImageFailure => { return { failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , imageId : output . imageId !== undefined && output . imageId !== null ? deserializeAws_json1_1ImageIdentifier ( output . imageId , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ImageFailureList = ( output , context ) : ImageFailure [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImageFailure ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageIdentifier = ( output , context ) : ImageIdentifier => { return { imageDigest : __expectString ( output . imageDigest ) , imageTag : __expectString ( output . imageTag ) , } as any ; } ; const deserializeAws_json1_1ImageIdentifierList = ( output , context ) : ImageIdentifier [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImageIdentifier ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageList = ( output , context ) : Image [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Image ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageNotFoundException = ( output , context ) : ImageNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ImageReplicationStatus = ( output , context ) : ImageReplicationStatus => { return { failureCode : __expectString ( output . failureCode ) , region : __expectString ( output . region ) , registryId : __expectString ( output . registryId ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1ImageReplicationStatusList = ( output , context ) : ImageReplicationStatus [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImageReplicationStatus ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageScanFinding = ( output , context ) : ImageScanFinding => { return { attributes : output . attributes !== undefined && output . attributes !== null ? deserializeAws_json1_1AttributeList ( output . attributes , context ) : undefined , description : __expectString ( output . description ) , name : __expectString ( output . name ) , severity : __expectString ( output . severity ) , uri : __expectString ( output . uri ) , } as any ; } ; const deserializeAws_json1_1ImageScanFindingList = ( output , context ) : ImageScanFinding [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImageScanFinding ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImageScanFindings = ( output , context ) : ImageScanFindings => { return { enhancedFindings : output . enhancedFindings !== undefined && output . enhancedFindings !== null ? deserializeAws_json1_1EnhancedImageScanFindingList ( output . enhancedFindings , context ) : undefined , findingSeverityCounts : output . findingSeverityCounts !== undefined && output . findingSeverityCounts !== null ? deserializeAws_json1_1FindingSeverityCounts ( output . findingSeverityCounts , context ) : undefined , findings : output . findings !== undefined && output . findings !== null ? deserializeAws_json1_1ImageScanFindingList ( output . findings , context ) : undefined , imageScanCompletedAt : output . imageScanCompletedAt !== undefined && output . imageScanCompletedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . imageScanCompletedAt ) ) ) : undefined , vulnerabilitySourceUpdatedAt : output . vulnerabilitySourceUpdatedAt !== undefined && output . vulnerabilitySourceUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . vulnerabilitySourceUpdatedAt ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1ImageScanFindingsSummary = ( output , context ) : ImageScanFindingsSummary => { return { findingSeverityCounts : output . findingSeverityCounts !== undefined && output . findingSeverityCounts !== null ? deserializeAws_json1_1FindingSeverityCounts ( output . findingSeverityCounts , context ) : undefined , imageScanCompletedAt : output . imageScanCompletedAt !== undefined && output . imageScanCompletedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . imageScanCompletedAt ) ) ) : undefined , vulnerabilitySourceUpdatedAt : output . vulnerabilitySourceUpdatedAt !== undefined && output . vulnerabilitySourceUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . vulnerabilitySourceUpdatedAt ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1ImageScanningConfiguration = ( output , context ) : ImageScanningConfiguration => { return { scanOnPush : __expectBoolean ( output . scanOnPush ) , } as any ; } ; const deserializeAws_json1_1ImageScanStatus = ( output , context ) : ImageScanStatus => { return { description : __expectString ( output . description ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_1ImageTagAlreadyExistsException = ( output , context ) : ImageTagAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ImageTagList = ( 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_1ImageTagsList = ( 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_1InitiateLayerUploadResponse = ( output , context ) : InitiateLayerUploadResponse => { return { partSize : __expectLong ( output . partSize ) , uploadId : __expectString ( output . uploadId ) , } as any ; } ; const deserializeAws_json1_1InvalidLayerException = ( output , context ) : InvalidLayerException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidLayerPartException = ( output , context ) : InvalidLayerPartException => { return { lastValidByteReceived : __expectLong ( output . lastValidByteReceived ) , message : __expectString ( output . message ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , uploadId : __expectString ( output . uploadId ) , } as any ; } ; const deserializeAws_json1_1InvalidParameterException = ( output , context ) : InvalidParameterException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidTagParameterException = ( output , context ) : InvalidTagParameterException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1KmsException = ( output , context ) : KmsException => { return { kmsError : __expectString ( output . kmsError ) , message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1Layer = ( output , context ) : Layer => { return { layerAvailability : __expectString ( output . layerAvailability ) , layerDigest : __expectString ( output . layerDigest ) , layerSize : __expectLong ( output . layerSize ) , mediaType : __expectString ( output . mediaType ) , } as any ; } ; const deserializeAws_json1_1LayerAlreadyExistsException = ( output , context ) : LayerAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LayerFailure = ( output , context ) : LayerFailure => { return { failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , layerDigest : __expectString ( output . layerDigest ) , } as any ; } ; const deserializeAws_json1_1LayerFailureList = ( output , context ) : LayerFailure [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LayerFailure ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LayerInaccessibleException = ( output , context ) : LayerInaccessibleException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LayerList = ( output , context ) : Layer [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Layer ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LayerPartTooSmallException = ( output , context ) : LayerPartTooSmallException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LayersNotFoundException = ( output , context ) : LayersNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyNotFoundException = ( output , context ) : LifecyclePolicyNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewInProgressException = ( output , context ) : LifecyclePolicyPreviewInProgressException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewNotFoundException = ( output , context ) : LifecyclePolicyPreviewNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewResult = ( output , context ) : LifecyclePolicyPreviewResult => { return { action : output . action !== undefined && output . action !== null ? deserializeAws_json1_1LifecyclePolicyRuleAction ( output . action , context ) : undefined , appliedRulePriority : __expectInt32 ( output . appliedRulePriority ) , imageDigest : __expectString ( output . imageDigest ) , imagePushedAt : output . imagePushedAt !== undefined && output . imagePushedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . imagePushedAt ) ) ) : undefined , imageTags : output . imageTags !== undefined && output . imageTags !== null ? deserializeAws_json1_1ImageTagList ( output . imageTags , context ) : undefined , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewResultList = ( output , context ) : LifecyclePolicyPreviewResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1LifecyclePolicyPreviewResult ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1LifecyclePolicyPreviewSummary = ( output , context ) : LifecyclePolicyPreviewSummary => { return { expiringImageTotalCount : __expectInt32 ( output . expiringImageTotalCount ) , } as any ; } ; const deserializeAws_json1_1LifecyclePolicyRuleAction = ( output , context ) : LifecyclePolicyRuleAction => { return { type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_1LimitExceededException = ( output , context ) : LimitExceededException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ListImagesResponse = ( output , context ) : ListImagesResponse => { return { imageIds : output . imageIds !== undefined && output . imageIds !== null ? deserializeAws_json1_1ImageIdentifierList ( output . imageIds , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } 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_1PackageVulnerabilityDetails = ( output , context ) : PackageVulnerabilityDetails => { return { cvss : output . cvss !== undefined && output . cvss !== null ? deserializeAws_json1_1CvssScoreList ( output . cvss , context ) : undefined , referenceUrls : output . referenceUrls !== undefined && output . referenceUrls !== null ? deserializeAws_json1_1ReferenceUrlsList ( output . referenceUrls , context ) : undefined , relatedVulnerabilities : output . relatedVulnerabilities !== undefined && output . relatedVulnerabilities !== null ? deserializeAws_json1_1RelatedVulnerabilitiesList ( output . relatedVulnerabilities , context ) : undefined , source : __expectString ( output . source ) , sourceUrl : __expectString ( output . sourceUrl ) , vendorCreatedAt : output . vendorCreatedAt !== undefined && output . vendorCreatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . vendorCreatedAt ) ) ) : undefined , vendorSeverity : __expectString ( output . vendorSeverity ) , vendorUpdatedAt : output . vendorUpdatedAt !== undefined && output . vendorUpdatedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . vendorUpdatedAt ) ) ) : undefined , vulnerabilityId : __expectString ( output . vulnerabilityId ) , vulnerablePackages : output . vulnerablePackages !== undefined && output . vulnerablePackages !== null ? deserializeAws_json1_1VulnerablePackagesList ( output . vulnerablePackages , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PullThroughCacheRule = ( output , context ) : PullThroughCacheRule => { return { createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , ecrRepositoryPrefix : __expectString ( output . ecrRepositoryPrefix ) , registryId : __expectString ( output . registryId ) , upstreamRegistryUrl : __expectString ( output . upstreamRegistryUrl ) , } as any ; } ; const deserializeAws_json1_1PullThroughCacheRuleAlreadyExistsException = ( output , context ) : PullThroughCacheRuleAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1PullThroughCacheRuleList = ( output , context ) : PullThroughCacheRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1PullThroughCacheRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1PullThroughCacheRuleNotFoundException = ( output , context ) : PullThroughCacheRuleNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1PutImageResponse = ( output , context ) : PutImageResponse => { return { image : output . image !== undefined && output . image !== null ? deserializeAws_json1_1Image ( output . image , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PutImageScanningConfigurationResponse = ( output , context ) : PutImageScanningConfigurationResponse => { return { imageScanningConfiguration : output . imageScanningConfiguration !== undefined && output . imageScanningConfiguration !== null ? deserializeAws_json1_1ImageScanningConfiguration ( output . imageScanningConfiguration , context ) : undefined , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1PutImageTagMutabilityResponse = ( output , context ) : PutImageTagMutabilityResponse => { return { imageTagMutability : __expectString ( output . imageTagMutability ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1PutLifecyclePolicyResponse = ( output , context ) : PutLifecyclePolicyResponse => { return { lifecyclePolicyText : __expectString ( output . lifecyclePolicyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1PutRegistryPolicyResponse = ( output , context ) : PutRegistryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , } as any ; } ; const deserializeAws_json1_1PutRegistryScanningConfigurationResponse = ( output , context ) : PutRegistryScanningConfigurationResponse => { return { registryScanningConfiguration : output . registryScanningConfiguration !== undefined && output . registryScanningConfiguration !== null ? deserializeAws_json1_1RegistryScanningConfiguration ( output . registryScanningConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1PutReplicationConfigurationResponse = ( output , context ) : PutReplicationConfigurationResponse => { return { replicationConfiguration : output . replicationConfiguration !== undefined && output . replicationConfiguration !== null ? deserializeAws_json1_1ReplicationConfiguration ( output . replicationConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_json1_1Recommendation = ( output , context ) : Recommendation => { return { text : __expectString ( output . text ) , url : __expectString ( output . url ) , } as any ; } ; const deserializeAws_json1_1ReferencedImagesNotFoundException = ( output , context ) : ReferencedImagesNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ReferenceUrlsList = ( 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_1RegistryPolicyNotFoundException = ( output , context ) : RegistryPolicyNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RegistryScanningConfiguration = ( output , context ) : RegistryScanningConfiguration => { return { rules : output . rules !== undefined && output . rules !== null ? deserializeAws_json1_1RegistryScanningRuleList ( output . rules , context ) : undefined , scanType : __expectString ( output . scanType ) , } as any ; } ; const deserializeAws_json1_1RegistryScanningRule = ( output , context ) : RegistryScanningRule => { return { repositoryFilters : output . repositoryFilters !== undefined && output . repositoryFilters !== null ? deserializeAws_json1_1ScanningRepositoryFilterList ( output . repositoryFilters , context ) : undefined , scanFrequency : __expectString ( output . scanFrequency ) , } as any ; } ; const deserializeAws_json1_1RegistryScanningRuleList = ( output , context ) : RegistryScanningRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RegistryScanningRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RelatedVulnerabilitiesList = ( 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_1Remediation = ( output , context ) : Remediation => { return { recommendation : output . recommendation !== undefined && output . recommendation !== null ? deserializeAws_json1_1Recommendation ( output . recommendation , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReplicationConfiguration = ( output , context ) : ReplicationConfiguration => { return { rules : output . rules !== undefined && output . rules !== null ? deserializeAws_json1_1ReplicationRuleList ( output . rules , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReplicationDestination = ( output , context ) : ReplicationDestination => { return { region : __expectString ( output . region ) , registryId : __expectString ( output . registryId ) , } as any ; } ; const deserializeAws_json1_1ReplicationDestinationList = ( output , context ) : ReplicationDestination [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReplicationDestination ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ReplicationRule = ( output , context ) : ReplicationRule => { return { destinations : output . destinations !== undefined && output . destinations !== null ? deserializeAws_json1_1ReplicationDestinationList ( output . destinations , context ) : undefined , repositoryFilters : output . repositoryFilters !== undefined && output . repositoryFilters !== null ? deserializeAws_json1_1RepositoryFilterList ( output . repositoryFilters , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ReplicationRuleList = ( output , context ) : ReplicationRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ReplicationRule ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Repository = ( output , context ) : Repository => { return { createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , encryptionConfiguration : output . encryptionConfiguration !== undefined && output . encryptionConfiguration !== null ? deserializeAws_json1_1EncryptionConfiguration ( output . encryptionConfiguration , context ) : undefined , imageScanningConfiguration : output . imageScanningConfiguration !== undefined && output . imageScanningConfiguration !== null ? deserializeAws_json1_1ImageScanningConfiguration ( output . imageScanningConfiguration , context ) : undefined , imageTagMutability : __expectString ( output . imageTagMutability ) , registryId : __expectString ( output . registryId ) , repositoryArn : __expectString ( output . repositoryArn ) , repositoryName : __expectString ( output . repositoryName ) , repositoryUri : __expectString ( output . repositoryUri ) , } as any ; } ; const deserializeAws_json1_1RepositoryAlreadyExistsException = ( output , context ) : RepositoryAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RepositoryFilter = ( output , context ) : RepositoryFilter => { return { filter : __expectString ( output . filter ) , filterType : __expectString ( output . filterType ) , } as any ; } ; const deserializeAws_json1_1RepositoryFilterList = ( output , context ) : RepositoryFilter [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RepositoryFilter ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RepositoryList = ( output , context ) : Repository [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Repository ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RepositoryNotEmptyException = ( output , context ) : RepositoryNotEmptyException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RepositoryNotFoundException = ( output , context ) : RepositoryNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RepositoryPolicyNotFoundException = ( output , context ) : RepositoryPolicyNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RepositoryScanningConfiguration = ( output , context ) : RepositoryScanningConfiguration => { return { appliedScanFilters : output . appliedScanFilters !== undefined && output . appliedScanFilters !== null ? deserializeAws_json1_1ScanningRepositoryFilterList ( output . appliedScanFilters , context ) : undefined , repositoryArn : __expectString ( output . repositoryArn ) , repositoryName : __expectString ( output . repositoryName ) , scanFrequency : __expectString ( output . scanFrequency ) , scanOnPush : __expectBoolean ( output . scanOnPush ) , } as any ; } ; const deserializeAws_json1_1RepositoryScanningConfigurationFailure = ( output , context ) : RepositoryScanningConfigurationFailure => { return { failureCode : __expectString ( output . failureCode ) , failureReason : __expectString ( output . failureReason ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1RepositoryScanningConfigurationFailureList = ( output , context ) : RepositoryScanningConfigurationFailure [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RepositoryScanningConfigurationFailure ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1RepositoryScanningConfigurationList = ( output , context ) : RepositoryScanningConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1RepositoryScanningConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1Resource = ( output , context ) : Resource => { return { details : output . details !== undefined && output . details !== null ? deserializeAws_json1_1ResourceDetails ( output . details , context ) : undefined , id : __expectString ( output . id ) , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_json1_1Tags ( output . tags , context ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_1ResourceDetails = ( output , context ) : ResourceDetails => { return { awsEcrContainerImage : output . awsEcrContainerImage !== undefined && output . awsEcrContainerImage !== null ? deserializeAws_json1_1AwsEcrContainerImageDetails ( output . awsEcrContainerImage , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ResourceList = ( output , context ) : Resource [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Resource ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ScanningRepositoryFilter = ( output , context ) : ScanningRepositoryFilter => { return { filter : __expectString ( output . filter ) , filterType : __expectString ( output . filterType ) , } as any ; } ; const deserializeAws_json1_1ScanningRepositoryFilterList = ( output , context ) : ScanningRepositoryFilter [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ScanningRepositoryFilter ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ScanNotFoundException = ( output , context ) : ScanNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ScoreDetails = ( output , context ) : ScoreDetails => { return { cvss : output . cvss !== undefined && output . cvss !== null ? deserializeAws_json1_1CvssScoreDetails ( output . cvss , context ) : undefined , } as any ; } ; const deserializeAws_json1_1ServerException = ( output , context ) : ServerException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1SetRepositoryPolicyResponse = ( output , context ) : SetRepositoryPolicyResponse => { return { policyText : __expectString ( output . policyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1StartImageScanResponse = ( output , context ) : StartImageScanResponse => { return { imageId : output . imageId !== undefined && output . imageId !== null ? deserializeAws_json1_1ImageIdentifier ( output . imageId , context ) : undefined , imageScanStatus : output . imageScanStatus !== undefined && output . imageScanStatus !== null ? deserializeAws_json1_1ImageScanStatus ( output . imageScanStatus , context ) : undefined , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , } as any ; } ; const deserializeAws_json1_1StartLifecyclePolicyPreviewResponse = ( output , context ) : StartLifecyclePolicyPreviewResponse => { return { lifecyclePolicyText : __expectString ( output . lifecyclePolicyText ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , status : __expectString ( output . status ) , } 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_1Tags = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_json1_1TooManyTagsException = ( output , context ) : TooManyTagsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedImageTypeException = ( output , context ) : UnsupportedImageTypeException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedUpstreamRegistryException = ( output , context ) : UnsupportedUpstreamRegistryException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UntagResourceResponse = ( output , context ) : UntagResourceResponse => { return { } as any ; } ; const deserializeAws_json1_1UploadLayerPartResponse = ( output , context ) : UploadLayerPartResponse => { return { lastByteReceived : __expectLong ( output . lastByteReceived ) , registryId : __expectString ( output . registryId ) , repositoryName : __expectString ( output . repositoryName ) , uploadId : __expectString ( output . uploadId ) , } as any ; } ; const deserializeAws_json1_1UploadNotFoundException = ( output , context ) : UploadNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ValidationException = ( output , context ) : ValidationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1VulnerablePackage = ( output , context ) : VulnerablePackage => { return { arch : __expectString ( output . arch ) , epoch : __expectInt32 ( output . epoch ) , filePath : __expectString ( output . filePath ) , name : __expectString ( output . name ) , packageManager : __expectString ( output . packageManager ) , release : __expectString ( output . release ) , sourceLayerHash : __expectString ( output . sourceLayerHash ) , version : __expectString ( output . version ) , } as any ; } ; const deserializeAws_json1_1VulnerablePackagesList = ( output , context ) : VulnerablePackage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1VulnerablePackage ( entry , context ) ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;