import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectString as __expectString , parseEpochTimestamp as __parseEpochTimestamp , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , HeaderBag as __HeaderBag , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { v4 as generateIdempotencyToken } from "uuid" ; import { AcceptEnvironmentAccountConnectionCommandInput , AcceptEnvironmentAccountConnectionCommandOutput , } from "../commands/AcceptEnvironmentAccountConnectionCommand" ; import { CancelEnvironmentDeploymentCommandInput , CancelEnvironmentDeploymentCommandOutput , } from "../commands/CancelEnvironmentDeploymentCommand" ; import { CancelServiceInstanceDeploymentCommandInput , CancelServiceInstanceDeploymentCommandOutput , } from "../commands/CancelServiceInstanceDeploymentCommand" ; import { CancelServicePipelineDeploymentCommandInput , CancelServicePipelineDeploymentCommandOutput , } from "../commands/CancelServicePipelineDeploymentCommand" ; import { CreateEnvironmentAccountConnectionCommandInput , CreateEnvironmentAccountConnectionCommandOutput , } from "../commands/CreateEnvironmentAccountConnectionCommand" ; import { CreateEnvironmentCommandInput , CreateEnvironmentCommandOutput } from "../commands/CreateEnvironmentCommand" ; import { CreateEnvironmentTemplateCommandInput , CreateEnvironmentTemplateCommandOutput , } from "../commands/CreateEnvironmentTemplateCommand" ; import { CreateEnvironmentTemplateVersionCommandInput , CreateEnvironmentTemplateVersionCommandOutput , } from "../commands/CreateEnvironmentTemplateVersionCommand" ; import { CreateRepositoryCommandInput , CreateRepositoryCommandOutput } from "../commands/CreateRepositoryCommand" ; import { CreateServiceCommandInput , CreateServiceCommandOutput } from "../commands/CreateServiceCommand" ; import { CreateServiceTemplateCommandInput , CreateServiceTemplateCommandOutput , } from "../commands/CreateServiceTemplateCommand" ; import { CreateServiceTemplateVersionCommandInput , CreateServiceTemplateVersionCommandOutput , } from "../commands/CreateServiceTemplateVersionCommand" ; import { CreateTemplateSyncConfigCommandInput , CreateTemplateSyncConfigCommandOutput , } from "../commands/CreateTemplateSyncConfigCommand" ; import { DeleteEnvironmentAccountConnectionCommandInput , DeleteEnvironmentAccountConnectionCommandOutput , } from "../commands/DeleteEnvironmentAccountConnectionCommand" ; import { DeleteEnvironmentCommandInput , DeleteEnvironmentCommandOutput } from "../commands/DeleteEnvironmentCommand" ; import { DeleteEnvironmentTemplateCommandInput , DeleteEnvironmentTemplateCommandOutput , } from "../commands/DeleteEnvironmentTemplateCommand" ; import { DeleteEnvironmentTemplateVersionCommandInput , DeleteEnvironmentTemplateVersionCommandOutput , } from "../commands/DeleteEnvironmentTemplateVersionCommand" ; import { DeleteRepositoryCommandInput , DeleteRepositoryCommandOutput } from "../commands/DeleteRepositoryCommand" ; import { DeleteServiceCommandInput , DeleteServiceCommandOutput } from "../commands/DeleteServiceCommand" ; import { DeleteServiceTemplateCommandInput , DeleteServiceTemplateCommandOutput , } from "../commands/DeleteServiceTemplateCommand" ; import { DeleteServiceTemplateVersionCommandInput , DeleteServiceTemplateVersionCommandOutput , } from "../commands/DeleteServiceTemplateVersionCommand" ; import { DeleteTemplateSyncConfigCommandInput , DeleteTemplateSyncConfigCommandOutput , } from "../commands/DeleteTemplateSyncConfigCommand" ; import { GetAccountSettingsCommandInput , GetAccountSettingsCommandOutput } from "../commands/GetAccountSettingsCommand" ; import { GetEnvironmentAccountConnectionCommandInput , GetEnvironmentAccountConnectionCommandOutput , } from "../commands/GetEnvironmentAccountConnectionCommand" ; import { GetEnvironmentCommandInput , GetEnvironmentCommandOutput } from "../commands/GetEnvironmentCommand" ; import { GetEnvironmentTemplateCommandInput , GetEnvironmentTemplateCommandOutput , } from "../commands/GetEnvironmentTemplateCommand" ; import { GetEnvironmentTemplateVersionCommandInput , GetEnvironmentTemplateVersionCommandOutput , } from "../commands/GetEnvironmentTemplateVersionCommand" ; import { GetRepositoryCommandInput , GetRepositoryCommandOutput } from "../commands/GetRepositoryCommand" ; import { GetRepositorySyncStatusCommandInput , GetRepositorySyncStatusCommandOutput , } from "../commands/GetRepositorySyncStatusCommand" ; import { GetServiceCommandInput , GetServiceCommandOutput } from "../commands/GetServiceCommand" ; import { GetServiceInstanceCommandInput , GetServiceInstanceCommandOutput } from "../commands/GetServiceInstanceCommand" ; import { GetServiceTemplateCommandInput , GetServiceTemplateCommandOutput } from "../commands/GetServiceTemplateCommand" ; import { GetServiceTemplateVersionCommandInput , GetServiceTemplateVersionCommandOutput , } from "../commands/GetServiceTemplateVersionCommand" ; import { GetTemplateSyncConfigCommandInput , GetTemplateSyncConfigCommandOutput , } from "../commands/GetTemplateSyncConfigCommand" ; import { GetTemplateSyncStatusCommandInput , GetTemplateSyncStatusCommandOutput , } from "../commands/GetTemplateSyncStatusCommand" ; import { ListEnvironmentAccountConnectionsCommandInput , ListEnvironmentAccountConnectionsCommandOutput , } from "../commands/ListEnvironmentAccountConnectionsCommand" ; import { ListEnvironmentOutputsCommandInput , ListEnvironmentOutputsCommandOutput , } from "../commands/ListEnvironmentOutputsCommand" ; import { ListEnvironmentProvisionedResourcesCommandInput , ListEnvironmentProvisionedResourcesCommandOutput , } from "../commands/ListEnvironmentProvisionedResourcesCommand" ; import { ListEnvironmentsCommandInput , ListEnvironmentsCommandOutput } from "../commands/ListEnvironmentsCommand" ; import { ListEnvironmentTemplatesCommandInput , ListEnvironmentTemplatesCommandOutput , } from "../commands/ListEnvironmentTemplatesCommand" ; import { ListEnvironmentTemplateVersionsCommandInput , ListEnvironmentTemplateVersionsCommandOutput , } from "../commands/ListEnvironmentTemplateVersionsCommand" ; import { ListRepositoriesCommandInput , ListRepositoriesCommandOutput } from "../commands/ListRepositoriesCommand" ; import { ListRepositorySyncDefinitionsCommandInput , ListRepositorySyncDefinitionsCommandOutput , } from "../commands/ListRepositorySyncDefinitionsCommand" ; import { ListServiceInstanceOutputsCommandInput , ListServiceInstanceOutputsCommandOutput , } from "../commands/ListServiceInstanceOutputsCommand" ; import { ListServiceInstanceProvisionedResourcesCommandInput , ListServiceInstanceProvisionedResourcesCommandOutput , } from "../commands/ListServiceInstanceProvisionedResourcesCommand" ; import { ListServiceInstancesCommandInput , ListServiceInstancesCommandOutput , } from "../commands/ListServiceInstancesCommand" ; import { ListServicePipelineOutputsCommandInput , ListServicePipelineOutputsCommandOutput , } from "../commands/ListServicePipelineOutputsCommand" ; import { ListServicePipelineProvisionedResourcesCommandInput , ListServicePipelineProvisionedResourcesCommandOutput , } from "../commands/ListServicePipelineProvisionedResourcesCommand" ; import { ListServicesCommandInput , ListServicesCommandOutput } from "../commands/ListServicesCommand" ; import { ListServiceTemplatesCommandInput , ListServiceTemplatesCommandOutput , } from "../commands/ListServiceTemplatesCommand" ; import { ListServiceTemplateVersionsCommandInput , ListServiceTemplateVersionsCommandOutput , } from "../commands/ListServiceTemplateVersionsCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { NotifyResourceDeploymentStatusChangeCommandInput , NotifyResourceDeploymentStatusChangeCommandOutput , } from "../commands/NotifyResourceDeploymentStatusChangeCommand" ; import { RejectEnvironmentAccountConnectionCommandInput , RejectEnvironmentAccountConnectionCommandOutput , } from "../commands/RejectEnvironmentAccountConnectionCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateAccountSettingsCommandInput , UpdateAccountSettingsCommandOutput , } from "../commands/UpdateAccountSettingsCommand" ; import { UpdateEnvironmentAccountConnectionCommandInput , UpdateEnvironmentAccountConnectionCommandOutput , } from "../commands/UpdateEnvironmentAccountConnectionCommand" ; import { UpdateEnvironmentCommandInput , UpdateEnvironmentCommandOutput } from "../commands/UpdateEnvironmentCommand" ; import { UpdateEnvironmentTemplateCommandInput , UpdateEnvironmentTemplateCommandOutput , } from "../commands/UpdateEnvironmentTemplateCommand" ; import { UpdateEnvironmentTemplateVersionCommandInput , UpdateEnvironmentTemplateVersionCommandOutput , } from "../commands/UpdateEnvironmentTemplateVersionCommand" ; import { UpdateServiceCommandInput , UpdateServiceCommandOutput } from "../commands/UpdateServiceCommand" ; import { UpdateServiceInstanceCommandInput , UpdateServiceInstanceCommandOutput , } from "../commands/UpdateServiceInstanceCommand" ; import { UpdateServicePipelineCommandInput , UpdateServicePipelineCommandOutput , } from "../commands/UpdateServicePipelineCommand" ; import { UpdateServiceTemplateCommandInput , UpdateServiceTemplateCommandOutput , } from "../commands/UpdateServiceTemplateCommand" ; import { UpdateServiceTemplateVersionCommandInput , UpdateServiceTemplateVersionCommandOutput , } from "../commands/UpdateServiceTemplateVersionCommand" ; import { UpdateTemplateSyncConfigCommandInput , UpdateTemplateSyncConfigCommandOutput , } from "../commands/UpdateTemplateSyncConfigCommand" ; import { AcceptEnvironmentAccountConnectionInput , AcceptEnvironmentAccountConnectionOutput , AccessDeniedException , AccountSettings , CancelEnvironmentDeploymentInput , CancelEnvironmentDeploymentOutput , CancelServiceInstanceDeploymentInput , CancelServiceInstanceDeploymentOutput , CancelServicePipelineDeploymentInput , CancelServicePipelineDeploymentOutput , CompatibleEnvironmentTemplate , CompatibleEnvironmentTemplateInput , ConflictException , CreateEnvironmentAccountConnectionInput , CreateEnvironmentAccountConnectionOutput , CreateEnvironmentInput , CreateEnvironmentOutput , CreateEnvironmentTemplateInput , CreateEnvironmentTemplateOutput , CreateEnvironmentTemplateVersionInput , CreateEnvironmentTemplateVersionOutput , CreateRepositoryInput , CreateRepositoryOutput , CreateServiceInput , CreateServiceOutput , CreateServiceTemplateInput , CreateServiceTemplateOutput , CreateServiceTemplateVersionInput , CreateServiceTemplateVersionOutput , CreateTemplateSyncConfigInput , CreateTemplateSyncConfigOutput , DeleteEnvironmentAccountConnectionInput , DeleteEnvironmentAccountConnectionOutput , DeleteEnvironmentInput , DeleteEnvironmentOutput , DeleteEnvironmentTemplateInput , DeleteEnvironmentTemplateOutput , DeleteEnvironmentTemplateVersionInput , DeleteEnvironmentTemplateVersionOutput , DeleteRepositoryInput , DeleteRepositoryOutput , DeleteServiceInput , DeleteServiceOutput , DeleteServiceTemplateInput , DeleteServiceTemplateOutput , DeleteServiceTemplateVersionInput , DeleteServiceTemplateVersionOutput , DeleteTemplateSyncConfigInput , DeleteTemplateSyncConfigOutput , Environment , EnvironmentAccountConnection , EnvironmentAccountConnectionStatus , EnvironmentAccountConnectionSummary , EnvironmentSummary , EnvironmentTemplate , EnvironmentTemplateFilter , EnvironmentTemplateSummary , EnvironmentTemplateVersion , EnvironmentTemplateVersionSummary , GetAccountSettingsInput , GetAccountSettingsOutput , GetEnvironmentAccountConnectionInput , GetEnvironmentAccountConnectionOutput , GetEnvironmentInput , GetEnvironmentOutput , GetEnvironmentTemplateInput , GetEnvironmentTemplateOutput , GetEnvironmentTemplateVersionInput , GetEnvironmentTemplateVersionOutput , GetRepositoryInput , GetRepositoryOutput , GetRepositorySyncStatusInput , GetRepositorySyncStatusOutput , GetServiceInput , GetServiceInstanceInput , GetServiceInstanceOutput , GetServiceOutput , GetServiceTemplateInput , GetServiceTemplateOutput , GetServiceTemplateVersionInput , GetServiceTemplateVersionOutput , GetTemplateSyncConfigInput , GetTemplateSyncConfigOutput , GetTemplateSyncStatusInput , GetTemplateSyncStatusOutput , InternalServerException , ListEnvironmentAccountConnectionsInput , ListEnvironmentAccountConnectionsOutput , ListEnvironmentOutputsInput , ListEnvironmentOutputsOutput , ListEnvironmentProvisionedResourcesInput , ListEnvironmentProvisionedResourcesOutput , ListEnvironmentsInput , ListEnvironmentsOutput , ListEnvironmentTemplatesInput , ListEnvironmentTemplatesOutput , ListEnvironmentTemplateVersionsInput , ListEnvironmentTemplateVersionsOutput , ListRepositoriesInput , ListRepositoriesOutput , ListRepositorySyncDefinitionsInput , ListRepositorySyncDefinitionsOutput , ListServiceInstanceOutputsInput , ListServiceInstanceOutputsOutput , ListServiceInstanceProvisionedResourcesInput , ListServiceInstanceProvisionedResourcesOutput , ListServiceInstancesInput , ListServiceInstancesOutput , ListServicePipelineOutputsInput , ListServicePipelineOutputsOutput , ListServicePipelineProvisionedResourcesInput , ListServicePipelineProvisionedResourcesOutput , ListServicesInput , ListServicesOutput , ListServiceTemplatesInput , ListServiceTemplatesOutput , ListServiceTemplateVersionsInput , ListServiceTemplateVersionsOutput , ListTagsForResourceInput , ListTagsForResourceOutput , NotifyResourceDeploymentStatusChangeInput , NotifyResourceDeploymentStatusChangeOutput , Output , ProvisionedResource , RejectEnvironmentAccountConnectionInput , RejectEnvironmentAccountConnectionOutput , Repository , RepositoryBranch , RepositoryBranchInput , RepositorySummary , RepositorySyncAttempt , RepositorySyncDefinition , RepositorySyncEvent , ResourceNotFoundException , ResourceSyncAttempt , ResourceSyncEvent , Revision , S3ObjectSource , Service , ServiceInstance , ServiceInstanceSummary , ServicePipeline , ServiceQuotaExceededException , ServiceSummary , ServiceTemplate , ServiceTemplateSummary , ServiceTemplateVersion , ServiceTemplateVersionSummary , Tag , TagResourceInput , TagResourceOutput , TemplateSyncConfig , TemplateVersionSourceInput , ThrottlingException , UntagResourceInput , UntagResourceOutput , UpdateAccountSettingsInput , UpdateAccountSettingsOutput , UpdateEnvironmentAccountConnectionInput , UpdateEnvironmentAccountConnectionOutput , UpdateEnvironmentInput , UpdateEnvironmentOutput , UpdateEnvironmentTemplateInput , UpdateEnvironmentTemplateOutput , UpdateEnvironmentTemplateVersionInput , UpdateEnvironmentTemplateVersionOutput , UpdateServiceInput , UpdateServiceInstanceInput , UpdateServiceInstanceOutput , UpdateServiceOutput , UpdateServicePipelineInput , UpdateServicePipelineOutput , UpdateServiceTemplateInput , UpdateServiceTemplateOutput , UpdateServiceTemplateVersionInput , UpdateServiceTemplateVersionOutput , UpdateTemplateSyncConfigInput , UpdateTemplateSyncConfigOutput , ValidationException , } from "../models/models_0" ; export const serializeAws_json1_0AcceptEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.AcceptEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0AcceptEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CancelEnvironmentDeploymentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CancelEnvironmentDeployment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CancelEnvironmentDeploymentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CancelServiceInstanceDeploymentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CancelServiceInstanceDeployment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CancelServiceInstanceDeploymentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CancelServicePipelineDeploymentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CancelServicePipelineDeployment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CancelServicePipelineDeploymentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateEnvironment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateEnvironmentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateEnvironmentTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateEnvironmentTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateEnvironmentTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateEnvironmentTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateEnvironmentTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateEnvironmentTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateRepositoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateRepository" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateRepositoryInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateServiceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateService" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateServiceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateServiceTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateServiceTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateServiceTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateServiceTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateServiceTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateServiceTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0CreateTemplateSyncConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.CreateTemplateSyncConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0CreateTemplateSyncConfigInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteEnvironment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteEnvironmentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteEnvironmentTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteEnvironmentTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteEnvironmentTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteEnvironmentTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteEnvironmentTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteEnvironmentTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteRepositoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteRepository" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteRepositoryInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteServiceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteService" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteServiceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteServiceTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteServiceTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteServiceTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteServiceTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteServiceTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteServiceTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0DeleteTemplateSyncConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.DeleteTemplateSyncConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0DeleteTemplateSyncConfigInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetAccountSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetAccountSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetAccountSettingsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetEnvironment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetEnvironmentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetEnvironmentTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetEnvironmentTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetEnvironmentTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetEnvironmentTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetEnvironmentTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetEnvironmentTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetRepositoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetRepository" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetRepositoryInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetRepositorySyncStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetRepositorySyncStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetRepositorySyncStatusInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetServiceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetService" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetServiceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetServiceInstanceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetServiceInstance" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetServiceInstanceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetServiceTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetServiceTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetServiceTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetServiceTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetServiceTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetServiceTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetTemplateSyncConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetTemplateSyncConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetTemplateSyncConfigInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0GetTemplateSyncStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.GetTemplateSyncStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0GetTemplateSyncStatusInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentAccountConnectionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironmentAccountConnections" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentAccountConnectionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentOutputsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironmentOutputs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentOutputsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentProvisionedResourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironmentProvisionedResources" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentProvisionedResourcesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironments" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentTemplatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironmentTemplates" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentTemplatesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListEnvironmentTemplateVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListEnvironmentTemplateVersions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListEnvironmentTemplateVersionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListRepositoriesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListRepositories" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListRepositoriesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListRepositorySyncDefinitionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListRepositorySyncDefinitions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListRepositorySyncDefinitionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServiceInstanceOutputsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServiceInstanceOutputs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServiceInstanceOutputsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServiceInstanceProvisionedResourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServiceInstanceProvisionedResources" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServiceInstanceProvisionedResourcesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServiceInstancesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServiceInstances" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServiceInstancesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServicePipelineOutputsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServicePipelineOutputs" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServicePipelineOutputsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServicePipelineProvisionedResourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServicePipelineProvisionedResources" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServicePipelineProvisionedResourcesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServicesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServices" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServicesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServiceTemplatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServiceTemplates" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServiceTemplatesInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListServiceTemplateVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListServiceTemplateVersions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListServiceTemplateVersionsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.ListTagsForResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0ListTagsForResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0NotifyResourceDeploymentStatusChangeCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.NotifyResourceDeploymentStatusChange" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0NotifyResourceDeploymentStatusChangeInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0RejectEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.RejectEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0RejectEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.TagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0TagResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UntagResource" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UntagResourceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateAccountSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateAccountSettings" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateAccountSettingsInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateEnvironmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateEnvironment" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateEnvironmentInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateEnvironmentAccountConnectionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateEnvironmentAccountConnection" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateEnvironmentAccountConnectionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateEnvironmentTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateEnvironmentTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateEnvironmentTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateEnvironmentTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateEnvironmentTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateEnvironmentTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateServiceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateService" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateServiceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateServiceInstanceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateServiceInstance" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateServiceInstanceInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateServicePipelineCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateServicePipeline" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateServicePipelineInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateServiceTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateServiceTemplate" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateServiceTemplateInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateServiceTemplateVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateServiceTemplateVersion" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateServiceTemplateVersionInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_0UpdateTemplateSyncConfigCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.0" , "x-amz-target" : "AwsProton20200720.UpdateTemplateSyncConfig" , } ; let body ; body = JSON . stringify ( serializeAws_json1_0UpdateTemplateSyncConfigInput ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_0AcceptEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < AcceptEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0AcceptEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0AcceptEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0AcceptEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < AcceptEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CancelEnvironmentDeploymentCommand = async ( output , context ) : Promise < CancelEnvironmentDeploymentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CancelEnvironmentDeploymentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CancelEnvironmentDeploymentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CancelEnvironmentDeploymentCommandError = async ( output , context ) : Promise < CancelEnvironmentDeploymentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CancelServiceInstanceDeploymentCommand = async ( output , context ) : Promise < CancelServiceInstanceDeploymentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CancelServiceInstanceDeploymentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CancelServiceInstanceDeploymentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CancelServiceInstanceDeploymentCommandError = async ( output , context ) : Promise < CancelServiceInstanceDeploymentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CancelServicePipelineDeploymentCommand = async ( output , context ) : Promise < CancelServicePipelineDeploymentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CancelServicePipelineDeploymentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CancelServicePipelineDeploymentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CancelServicePipelineDeploymentCommandError = async ( output , context ) : Promise < CancelServicePipelineDeploymentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateEnvironmentCommand = async ( output , context ) : Promise < CreateEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateEnvironmentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateEnvironmentCommandError = async ( output , context ) : Promise < CreateEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < CreateEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < CreateEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateEnvironmentTemplateCommand = async ( output , context ) : Promise < CreateEnvironmentTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateEnvironmentTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateEnvironmentTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateEnvironmentTemplateCommandError = async ( output , context ) : Promise < CreateEnvironmentTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateEnvironmentTemplateVersionCommand = async ( output , context ) : Promise < CreateEnvironmentTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateEnvironmentTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateEnvironmentTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateEnvironmentTemplateVersionCommandError = async ( output , context ) : Promise < CreateEnvironmentTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateRepositoryCommand = async ( output , context ) : Promise < CreateRepositoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateRepositoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateRepositoryOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateRepositoryCommandError = 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 "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateServiceCommand = async ( output , context ) : Promise < CreateServiceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateServiceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateServiceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateServiceCommandError = async ( output , context ) : Promise < CreateServiceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateServiceTemplateCommand = async ( output , context ) : Promise < CreateServiceTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateServiceTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateServiceTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateServiceTemplateCommandError = async ( output , context ) : Promise < CreateServiceTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateServiceTemplateVersionCommand = async ( output , context ) : Promise < CreateServiceTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateServiceTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateServiceTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateServiceTemplateVersionCommandError = async ( output , context ) : Promise < CreateServiceTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0CreateTemplateSyncConfigCommand = async ( output , context ) : Promise < CreateTemplateSyncConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0CreateTemplateSyncConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0CreateTemplateSyncConfigOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0CreateTemplateSyncConfigCommandError = async ( output , context ) : Promise < CreateTemplateSyncConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteEnvironmentCommand = async ( output , context ) : Promise < DeleteEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteEnvironmentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteEnvironmentCommandError = async ( output , context ) : Promise < DeleteEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < DeleteEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < DeleteEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteEnvironmentTemplateCommand = async ( output , context ) : Promise < DeleteEnvironmentTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteEnvironmentTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteEnvironmentTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteEnvironmentTemplateCommandError = async ( output , context ) : Promise < DeleteEnvironmentTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteEnvironmentTemplateVersionCommand = async ( output , context ) : Promise < DeleteEnvironmentTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteEnvironmentTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteEnvironmentTemplateVersionCommandError = async ( output , context ) : Promise < DeleteEnvironmentTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteRepositoryCommand = async ( output , context ) : Promise < DeleteRepositoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteRepositoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteRepositoryOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteRepositoryCommandError = 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 "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteServiceCommand = async ( output , context ) : Promise < DeleteServiceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteServiceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteServiceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteServiceCommandError = async ( output , context ) : Promise < DeleteServiceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteServiceTemplateCommand = async ( output , context ) : Promise < DeleteServiceTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteServiceTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteServiceTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteServiceTemplateCommandError = async ( output , context ) : Promise < DeleteServiceTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteServiceTemplateVersionCommand = async ( output , context ) : Promise < DeleteServiceTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteServiceTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteServiceTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteServiceTemplateVersionCommandError = async ( output , context ) : Promise < DeleteServiceTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0DeleteTemplateSyncConfigCommand = async ( output , context ) : Promise < DeleteTemplateSyncConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0DeleteTemplateSyncConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0DeleteTemplateSyncConfigOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0DeleteTemplateSyncConfigCommandError = async ( output , context ) : Promise < DeleteTemplateSyncConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetAccountSettingsCommand = async ( output , context ) : Promise < GetAccountSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetAccountSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetAccountSettingsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetAccountSettingsCommandError = async ( output , context ) : Promise < GetAccountSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetEnvironmentCommand = async ( output , context ) : Promise < GetEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetEnvironmentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetEnvironmentCommandError = async ( output , context ) : Promise < GetEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < GetEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < GetEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetEnvironmentTemplateCommand = async ( output , context ) : Promise < GetEnvironmentTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetEnvironmentTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetEnvironmentTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetEnvironmentTemplateCommandError = async ( output , context ) : Promise < GetEnvironmentTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetEnvironmentTemplateVersionCommand = async ( output , context ) : Promise < GetEnvironmentTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetEnvironmentTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetEnvironmentTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetEnvironmentTemplateVersionCommandError = async ( output , context ) : Promise < GetEnvironmentTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetRepositoryCommand = async ( output , context ) : Promise < GetRepositoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetRepositoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetRepositoryOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetRepositoryCommandError = async ( output , context ) : Promise < GetRepositoryCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetRepositorySyncStatusCommand = async ( output , context ) : Promise < GetRepositorySyncStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetRepositorySyncStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetRepositorySyncStatusOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetRepositorySyncStatusCommandError = async ( output , context ) : Promise < GetRepositorySyncStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetServiceCommand = async ( output , context ) : Promise < GetServiceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetServiceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetServiceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetServiceCommandError = async ( output , context ) : Promise < GetServiceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetServiceInstanceCommand = async ( output , context ) : Promise < GetServiceInstanceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetServiceInstanceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetServiceInstanceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetServiceInstanceCommandError = async ( output , context ) : Promise < GetServiceInstanceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetServiceTemplateCommand = async ( output , context ) : Promise < GetServiceTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetServiceTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetServiceTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetServiceTemplateCommandError = async ( output , context ) : Promise < GetServiceTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetServiceTemplateVersionCommand = async ( output , context ) : Promise < GetServiceTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetServiceTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetServiceTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetServiceTemplateVersionCommandError = async ( output , context ) : Promise < GetServiceTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetTemplateSyncConfigCommand = async ( output , context ) : Promise < GetTemplateSyncConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetTemplateSyncConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetTemplateSyncConfigOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetTemplateSyncConfigCommandError = async ( output , context ) : Promise < GetTemplateSyncConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0GetTemplateSyncStatusCommand = async ( output , context ) : Promise < GetTemplateSyncStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0GetTemplateSyncStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0GetTemplateSyncStatusOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0GetTemplateSyncStatusCommandError = async ( output , context ) : Promise < GetTemplateSyncStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentAccountConnectionsCommand = async ( output , context ) : Promise < ListEnvironmentAccountConnectionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentAccountConnectionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentAccountConnectionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentAccountConnectionsCommandError = async ( output , context ) : Promise < ListEnvironmentAccountConnectionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentOutputsCommand = async ( output , context ) : Promise < ListEnvironmentOutputsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentOutputsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentOutputsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentOutputsCommandError = async ( output , context ) : Promise < ListEnvironmentOutputsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentProvisionedResourcesCommand = async ( output , context ) : Promise < ListEnvironmentProvisionedResourcesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentProvisionedResourcesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentProvisionedResourcesCommandError = async ( output , context ) : Promise < ListEnvironmentProvisionedResourcesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentsCommand = async ( output , context ) : Promise < ListEnvironmentsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentsCommandError = async ( output , context ) : Promise < ListEnvironmentsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentTemplatesCommand = async ( output , context ) : Promise < ListEnvironmentTemplatesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentTemplatesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentTemplatesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentTemplatesCommandError = async ( output , context ) : Promise < ListEnvironmentTemplatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListEnvironmentTemplateVersionsCommand = async ( output , context ) : Promise < ListEnvironmentTemplateVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListEnvironmentTemplateVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListEnvironmentTemplateVersionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListEnvironmentTemplateVersionsCommandError = async ( output , context ) : Promise < ListEnvironmentTemplateVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListRepositoriesCommand = async ( output , context ) : Promise < ListRepositoriesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListRepositoriesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListRepositoriesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListRepositoriesCommandError = async ( output , context ) : Promise < ListRepositoriesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListRepositorySyncDefinitionsCommand = async ( output , context ) : Promise < ListRepositorySyncDefinitionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListRepositorySyncDefinitionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListRepositorySyncDefinitionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListRepositorySyncDefinitionsCommandError = async ( output , context ) : Promise < ListRepositorySyncDefinitionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServiceInstanceOutputsCommand = async ( output , context ) : Promise < ListServiceInstanceOutputsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServiceInstanceOutputsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServiceInstanceOutputsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServiceInstanceOutputsCommandError = async ( output , context ) : Promise < ListServiceInstanceOutputsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServiceInstanceProvisionedResourcesCommand = async ( output , context ) : Promise < ListServiceInstanceProvisionedResourcesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServiceInstanceProvisionedResourcesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServiceInstanceProvisionedResourcesCommandError = async ( output , context ) : Promise < ListServiceInstanceProvisionedResourcesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServiceInstancesCommand = async ( output , context ) : Promise < ListServiceInstancesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServiceInstancesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServiceInstancesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServiceInstancesCommandError = async ( output , context ) : Promise < ListServiceInstancesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServicePipelineOutputsCommand = async ( output , context ) : Promise < ListServicePipelineOutputsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServicePipelineOutputsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServicePipelineOutputsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServicePipelineOutputsCommandError = async ( output , context ) : Promise < ListServicePipelineOutputsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServicePipelineProvisionedResourcesCommand = async ( output , context ) : Promise < ListServicePipelineProvisionedResourcesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServicePipelineProvisionedResourcesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServicePipelineProvisionedResourcesCommandError = async ( output , context ) : Promise < ListServicePipelineProvisionedResourcesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServicesCommand = async ( output , context ) : Promise < ListServicesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServicesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServicesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServicesCommandError = async ( output , context ) : Promise < ListServicesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServiceTemplatesCommand = async ( output , context ) : Promise < ListServiceTemplatesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServiceTemplatesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServiceTemplatesOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServiceTemplatesCommandError = async ( output , context ) : Promise < ListServiceTemplatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListServiceTemplateVersionsCommand = async ( output , context ) : Promise < ListServiceTemplateVersionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListServiceTemplateVersionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListServiceTemplateVersionsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListServiceTemplateVersionsCommandError = async ( output , context ) : Promise < ListServiceTemplateVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0ListTagsForResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0ListTagsForResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0NotifyResourceDeploymentStatusChangeCommand = async ( output , context ) : Promise < NotifyResourceDeploymentStatusChangeCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0NotifyResourceDeploymentStatusChangeOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0NotifyResourceDeploymentStatusChangeCommandError = async ( output , context ) : Promise < NotifyResourceDeploymentStatusChangeCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0RejectEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < RejectEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0RejectEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0RejectEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0RejectEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < RejectEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0TagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0TagResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UntagResourceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UntagResourceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateAccountSettingsCommand = async ( output , context ) : Promise < UpdateAccountSettingsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateAccountSettingsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateAccountSettingsOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateAccountSettingsCommandError = async ( output , context ) : Promise < UpdateAccountSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateEnvironmentCommand = async ( output , context ) : Promise < UpdateEnvironmentCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateEnvironmentCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateEnvironmentOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateEnvironmentCommandError = async ( output , context ) : Promise < UpdateEnvironmentCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateEnvironmentAccountConnectionCommand = async ( output , context ) : Promise < UpdateEnvironmentAccountConnectionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateEnvironmentAccountConnectionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateEnvironmentAccountConnectionCommandError = async ( output , context ) : Promise < UpdateEnvironmentAccountConnectionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateEnvironmentTemplateCommand = async ( output , context ) : Promise < UpdateEnvironmentTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateEnvironmentTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateEnvironmentTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateEnvironmentTemplateCommandError = async ( output , context ) : Promise < UpdateEnvironmentTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateEnvironmentTemplateVersionCommand = async ( output , context ) : Promise < UpdateEnvironmentTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateEnvironmentTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateEnvironmentTemplateVersionCommandError = async ( output , context ) : Promise < UpdateEnvironmentTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateServiceCommand = async ( output , context ) : Promise < UpdateServiceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateServiceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateServiceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateServiceCommandError = async ( output , context ) : Promise < UpdateServiceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ServiceQuotaExceededException" : case "com.amazonaws.proton#ServiceQuotaExceededException" : response = { ... ( await deserializeAws_json1_0ServiceQuotaExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateServiceInstanceCommand = async ( output , context ) : Promise < UpdateServiceInstanceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateServiceInstanceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateServiceInstanceOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateServiceInstanceCommandError = async ( output , context ) : Promise < UpdateServiceInstanceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateServicePipelineCommand = async ( output , context ) : Promise < UpdateServicePipelineCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateServicePipelineCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateServicePipelineOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateServicePipelineCommandError = async ( output , context ) : Promise < UpdateServicePipelineCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateServiceTemplateCommand = async ( output , context ) : Promise < UpdateServiceTemplateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateServiceTemplateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateServiceTemplateOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateServiceTemplateCommandError = async ( output , context ) : Promise < UpdateServiceTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateServiceTemplateVersionCommand = async ( output , context ) : Promise < UpdateServiceTemplateVersionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateServiceTemplateVersionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateServiceTemplateVersionOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateServiceTemplateVersionCommandError = async ( output , context ) : Promise < UpdateServiceTemplateVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0UpdateTemplateSyncConfigCommand = async ( output , context ) : Promise < UpdateTemplateSyncConfigCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_0UpdateTemplateSyncConfigCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_0UpdateTemplateSyncConfigOutput ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_0UpdateTemplateSyncConfigCommandError = async ( output , context ) : Promise < UpdateTemplateSyncConfigCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.proton#AccessDeniedException" : response = { ... ( await deserializeAws_json1_0AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.proton#ConflictException" : response = { ... ( await deserializeAws_json1_0ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalServerException" : case "com.amazonaws.proton#InternalServerException" : response = { ... ( await deserializeAws_json1_0InternalServerExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.proton#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_0ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.proton#ThrottlingException" : response = { ... ( await deserializeAws_json1_0ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ValidationException" : case "com.amazonaws.proton#ValidationException" : response = { ... ( await deserializeAws_json1_0ValidationExceptionResponse ( 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_0AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0AccessDeniedException ( body , context ) ; const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ConflictException ( body , context ) ; const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0InternalServerExceptionResponse = async ( parsedOutput , context ) : Promise < InternalServerException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0InternalServerException ( body , context ) ; const contents = { name : "InternalServerException" , $fault : "server" , $retryable : { } , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ServiceQuotaExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ServiceQuotaExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ServiceQuotaExceededException ( body , context ) ; const contents = { name : "ServiceQuotaExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ThrottlingException ( body , context ) ; const contents = { name : "ThrottlingException" , $fault : "client" , $retryable : { throttling : true , } , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_0ValidationExceptionResponse = async ( parsedOutput , context ) : Promise < ValidationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_0ValidationException ( body , context ) ; const contents = { name : "ValidationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_0AcceptEnvironmentAccountConnectionInput = ( input , context ) : any => { return { ... ( input . id !== undefined && input . id !== null && { id : input . id } ) , } ; } ; const serializeAws_json1_0CancelEnvironmentDeploymentInput = ( input , context ) : any => { return { ... ( input . environmentName !== undefined && input . environmentName !== null && { environmentName : input . environmentName } ) , } ; } ; const serializeAws_json1_0CancelServiceInstanceDeploymentInput = ( input , context ) : any => { return { ... ( input . serviceInstanceName !== undefined && input . serviceInstanceName !== null && { serviceInstanceName : input . serviceInstanceName } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0CancelServicePipelineDeploymentInput = ( input , context ) : any => { return { ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0CompatibleEnvironmentTemplateInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0CompatibleEnvironmentTemplateInputList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0CompatibleEnvironmentTemplateInput ( entry , context ) ; } ) ; } ; const serializeAws_json1_0CreateEnvironmentAccountConnectionInput = ( input , context ) : any => { return { clientToken : input . clientToken ?? generateIdempotencyToken ( ) , ... ( input . environmentName !== undefined && input . environmentName !== null && { environmentName : input . environmentName } ) , ... ( input . managementAccountId !== undefined && input . managementAccountId !== null && { managementAccountId : input . managementAccountId } ) , ... ( input . roleArn !== undefined && input . roleArn !== null && { roleArn : input . roleArn } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0CreateEnvironmentInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . environmentAccountConnectionId !== undefined && input . environmentAccountConnectionId !== null && { environmentAccountConnectionId : input . environmentAccountConnectionId , } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . protonServiceRoleArn !== undefined && input . protonServiceRoleArn !== null && { protonServiceRoleArn : input . protonServiceRoleArn } ) , ... ( input . provisioningRepository !== undefined && input . provisioningRepository !== null && { provisioningRepository : serializeAws_json1_0RepositoryBranchInput ( input . provisioningRepository , context ) , } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , ... ( input . templateMajorVersion !== undefined && input . templateMajorVersion !== null && { templateMajorVersion : input . templateMajorVersion } ) , ... ( input . templateMinorVersion !== undefined && input . templateMinorVersion !== null && { templateMinorVersion : input . templateMinorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0CreateEnvironmentTemplateInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . displayName !== undefined && input . displayName !== null && { displayName : input . displayName } ) , ... ( input . encryptionKey !== undefined && input . encryptionKey !== null && { encryptionKey : input . encryptionKey } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . provisioning !== undefined && input . provisioning !== null && { provisioning : input . provisioning } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0CreateEnvironmentTemplateVersionInput = ( input , context ) : any => { return { clientToken : input . clientToken ?? generateIdempotencyToken ( ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . source !== undefined && input . source !== null && { source : serializeAws_json1_0TemplateVersionSourceInput ( input . source , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0CreateRepositoryInput = ( input , context ) : any => { return { ... ( input . connectionArn !== undefined && input . connectionArn !== null && { connectionArn : input . connectionArn } ) , ... ( input . encryptionKey !== undefined && input . encryptionKey !== null && { encryptionKey : input . encryptionKey } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . provider !== undefined && input . provider !== null && { provider : input . provider } ) , } ; } ; const serializeAws_json1_0CreateServiceInput = ( input , context ) : any => { return { ... ( input . branchName !== undefined && input . branchName !== null && { branchName : input . branchName } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . repositoryConnectionArn !== undefined && input . repositoryConnectionArn !== null && { repositoryConnectionArn : input . repositoryConnectionArn } ) , ... ( input . repositoryId !== undefined && input . repositoryId !== null && { repositoryId : input . repositoryId } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , ... ( input . templateMajorVersion !== undefined && input . templateMajorVersion !== null && { templateMajorVersion : input . templateMajorVersion } ) , ... ( input . templateMinorVersion !== undefined && input . templateMinorVersion !== null && { templateMinorVersion : input . templateMinorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0CreateServiceTemplateInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . displayName !== undefined && input . displayName !== null && { displayName : input . displayName } ) , ... ( input . encryptionKey !== undefined && input . encryptionKey !== null && { encryptionKey : input . encryptionKey } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . pipelineProvisioning !== undefined && input . pipelineProvisioning !== null && { pipelineProvisioning : input . pipelineProvisioning } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0CreateServiceTemplateVersionInput = ( input , context ) : any => { return { clientToken : input . clientToken ?? generateIdempotencyToken ( ) , ... ( input . compatibleEnvironmentTemplates !== undefined && input . compatibleEnvironmentTemplates !== null && { compatibleEnvironmentTemplates : serializeAws_json1_0CompatibleEnvironmentTemplateInputList ( input . compatibleEnvironmentTemplates , context ) , } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . source !== undefined && input . source !== null && { source : serializeAws_json1_0TemplateVersionSourceInput ( input . source , context ) } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0CreateTemplateSyncConfigInput = ( input , context ) : any => { return { ... ( input . branch !== undefined && input . branch !== null && { branch : input . branch } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . repositoryProvider !== undefined && input . repositoryProvider !== null && { repositoryProvider : input . repositoryProvider } ) , ... ( input . subdirectory !== undefined && input . subdirectory !== null && { subdirectory : input . subdirectory } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , ... ( input . templateType !== undefined && input . templateType !== null && { templateType : input . templateType } ) , } ; } ; const serializeAws_json1_0DeleteEnvironmentAccountConnectionInput = ( input , context ) : any => { return { ... ( input . id !== undefined && input . id !== null && { id : input . id } ) , } ; } ; const serializeAws_json1_0DeleteEnvironmentInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0DeleteEnvironmentTemplateInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0DeleteEnvironmentTemplateVersionInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0DeleteRepositoryInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . provider !== undefined && input . provider !== null && { provider : input . provider } ) , } ; } ; const serializeAws_json1_0DeleteServiceInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0DeleteServiceTemplateInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0DeleteServiceTemplateVersionInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0DeleteTemplateSyncConfigInput = ( input , context ) : any => { return { ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , ... ( input . templateType !== undefined && input . templateType !== null && { templateType : input . templateType } ) , } ; } ; const serializeAws_json1_0EnvironmentAccountConnectionStatusList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0EnvironmentTemplateFilter = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0EnvironmentTemplateFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0EnvironmentTemplateFilter ( entry , context ) ; } ) ; } ; const serializeAws_json1_0GetAccountSettingsInput = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_0GetEnvironmentAccountConnectionInput = ( input , context ) : any => { return { ... ( input . id !== undefined && input . id !== null && { id : input . id } ) , } ; } ; const serializeAws_json1_0GetEnvironmentInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0GetEnvironmentTemplateInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0GetEnvironmentTemplateVersionInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0GetRepositoryInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . provider !== undefined && input . provider !== null && { provider : input . provider } ) , } ; } ; const serializeAws_json1_0GetRepositorySyncStatusInput = ( input , context ) : any => { return { ... ( input . branch !== undefined && input . branch !== null && { branch : input . branch } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . repositoryProvider !== undefined && input . repositoryProvider !== null && { repositoryProvider : input . repositoryProvider } ) , ... ( input . syncType !== undefined && input . syncType !== null && { syncType : input . syncType } ) , } ; } ; const serializeAws_json1_0GetServiceInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0GetServiceInstanceInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0GetServiceTemplateInput = ( input , context ) : any => { return { ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0GetServiceTemplateVersionInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0GetTemplateSyncConfigInput = ( input , context ) : any => { return { ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , ... ( input . templateType !== undefined && input . templateType !== null && { templateType : input . templateType } ) , } ; } ; const serializeAws_json1_0GetTemplateSyncStatusInput = ( input , context ) : any => { return { ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , ... ( input . templateType !== undefined && input . templateType !== null && { templateType : input . templateType } ) , ... ( input . templateVersion !== undefined && input . templateVersion !== null && { templateVersion : input . templateVersion } ) , } ; } ; const serializeAws_json1_0ListEnvironmentAccountConnectionsInput = ( input , context ) : any => { return { ... ( input . environmentName !== undefined && input . environmentName !== null && { environmentName : input . environmentName } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . requestedBy !== undefined && input . requestedBy !== null && { requestedBy : input . requestedBy } ) , ... ( input . statuses !== undefined && input . statuses !== null && { statuses : serializeAws_json1_0EnvironmentAccountConnectionStatusList ( input . statuses , context ) , } ) , } ; } ; const serializeAws_json1_0ListEnvironmentOutputsInput = ( input , context ) : any => { return { ... ( input . environmentName !== undefined && input . environmentName !== null && { environmentName : input . environmentName } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListEnvironmentProvisionedResourcesInput = ( input , context ) : any => { return { ... ( input . environmentName !== undefined && input . environmentName !== null && { environmentName : input . environmentName } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListEnvironmentsInput = ( input , context ) : any => { return { ... ( input . environmentTemplates !== undefined && input . environmentTemplates !== null && { environmentTemplates : serializeAws_json1_0EnvironmentTemplateFilterList ( input . environmentTemplates , context ) , } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListEnvironmentTemplatesInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListEnvironmentTemplateVersionsInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0ListRepositoriesInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListRepositorySyncDefinitionsInput = ( input , context ) : any => { return { ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . repositoryProvider !== undefined && input . repositoryProvider !== null && { repositoryProvider : input . repositoryProvider } ) , ... ( input . syncType !== undefined && input . syncType !== null && { syncType : input . syncType } ) , } ; } ; const serializeAws_json1_0ListServiceInstanceOutputsInput = ( input , context ) : any => { return { ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . serviceInstanceName !== undefined && input . serviceInstanceName !== null && { serviceInstanceName : input . serviceInstanceName } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0ListServiceInstanceProvisionedResourcesInput = ( input , context ) : any => { return { ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . serviceInstanceName !== undefined && input . serviceInstanceName !== null && { serviceInstanceName : input . serviceInstanceName } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0ListServiceInstancesInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0ListServicePipelineOutputsInput = ( input , context ) : any => { return { ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0ListServicePipelineProvisionedResourcesInput = ( input , context ) : any => { return { ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , } ; } ; const serializeAws_json1_0ListServicesInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListServiceTemplatesInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , } ; } ; const serializeAws_json1_0ListServiceTemplateVersionsInput = ( input , context ) : any => { return { ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0ListTagsForResourceInput = ( input , context ) : any => { return { ... ( input . maxResults !== undefined && input . maxResults !== null && { maxResults : input . maxResults } ) , ... ( input . nextToken !== undefined && input . nextToken !== null && { nextToken : input . nextToken } ) , ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , } ; } ; const serializeAws_json1_0NotifyResourceDeploymentStatusChangeInput = ( input , context ) : any => { return { ... ( input . deploymentId !== undefined && input . deploymentId !== null && { deploymentId : input . deploymentId } ) , ... ( input . outputs !== undefined && input . outputs !== null && { outputs : serializeAws_json1_0OutputsList ( input . outputs , context ) } ) , ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , ... ( input . status !== undefined && input . status !== null && { status : input . status } ) , ... ( input . statusMessage !== undefined && input . statusMessage !== null && { statusMessage : input . statusMessage } ) , } ; } ; const serializeAws_json1_0Output = ( input , context ) : any => { return { ... ( input . key !== undefined && input . key !== null && { key : input . key } ) , ... ( input . valueString !== undefined && input . valueString !== null && { valueString : input . valueString } ) , } ; } ; const serializeAws_json1_0OutputsList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Output ( entry , context ) ; } ) ; } ; const serializeAws_json1_0RejectEnvironmentAccountConnectionInput = ( input , context ) : any => { return { ... ( input . id !== undefined && input . id !== null && { id : input . id } ) , } ; } ; const serializeAws_json1_0RepositoryBranchInput = ( input , context ) : any => { return { ... ( input . branch !== undefined && input . branch !== null && { branch : input . branch } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . provider !== undefined && input . provider !== null && { provider : input . provider } ) , } ; } ; const serializeAws_json1_0S3ObjectSource = ( input , context ) : any => { return { ... ( input . bucket !== undefined && input . bucket !== null && { bucket : input . bucket } ) , ... ( input . key !== undefined && input . key !== null && { key : input . key } ) , } ; } ; const serializeAws_json1_0Tag = ( 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_0TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_0TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_0TagResourceInput = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , ... ( input . tags !== undefined && input . tags !== null && { tags : serializeAws_json1_0TagList ( input . tags , context ) } ) , } ; } ; const serializeAws_json1_0TemplateVersionSourceInput = ( input , context ) : any => { return TemplateVersionSourceInput . visit ( input , { s3 : ( value ) => ( { s3 : serializeAws_json1_0S3ObjectSource ( value , context ) } ) , _ : ( name , value ) => ( { name : value } as any ) , } ) ; } ; const serializeAws_json1_0UntagResourceInput = ( input , context ) : any => { return { ... ( input . resourceArn !== undefined && input . resourceArn !== null && { resourceArn : input . resourceArn } ) , ... ( input . tagKeys !== undefined && input . tagKeys !== null && { tagKeys : serializeAws_json1_0TagKeyList ( input . tagKeys , context ) } ) , } ; } ; const serializeAws_json1_0UpdateAccountSettingsInput = ( input , context ) : any => { return { ... ( input . pipelineProvisioningRepository !== undefined && input . pipelineProvisioningRepository !== null && { pipelineProvisioningRepository : serializeAws_json1_0RepositoryBranchInput ( input . pipelineProvisioningRepository , context ) , } ) , ... ( input . pipelineServiceRoleArn !== undefined && input . pipelineServiceRoleArn !== null && { pipelineServiceRoleArn : input . pipelineServiceRoleArn } ) , } ; } ; const serializeAws_json1_0UpdateEnvironmentAccountConnectionInput = ( input , context ) : any => { return { ... ( input . id !== undefined && input . id !== null && { id : input . id } ) , ... ( input . roleArn !== undefined && input . roleArn !== null && { roleArn : input . roleArn } ) , } ; } ; const serializeAws_json1_0UpdateEnvironmentInput = ( input , context ) : any => { return { ... ( input . deploymentType !== undefined && input . deploymentType !== null && { deploymentType : input . deploymentType } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . environmentAccountConnectionId !== undefined && input . environmentAccountConnectionId !== null && { environmentAccountConnectionId : input . environmentAccountConnectionId , } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . protonServiceRoleArn !== undefined && input . protonServiceRoleArn !== null && { protonServiceRoleArn : input . protonServiceRoleArn } ) , ... ( input . provisioningRepository !== undefined && input . provisioningRepository !== null && { provisioningRepository : serializeAws_json1_0RepositoryBranchInput ( input . provisioningRepository , context ) , } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , ... ( input . templateMajorVersion !== undefined && input . templateMajorVersion !== null && { templateMajorVersion : input . templateMajorVersion } ) , ... ( input . templateMinorVersion !== undefined && input . templateMinorVersion !== null && { templateMinorVersion : input . templateMinorVersion } ) , } ; } ; const serializeAws_json1_0UpdateEnvironmentTemplateInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . displayName !== undefined && input . displayName !== null && { displayName : input . displayName } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0UpdateEnvironmentTemplateVersionInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . status !== undefined && input . status !== null && { status : input . status } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0UpdateServiceInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , } ; } ; const serializeAws_json1_0UpdateServiceInstanceInput = ( input , context ) : any => { return { ... ( input . deploymentType !== undefined && input . deploymentType !== null && { deploymentType : input . deploymentType } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , ... ( input . templateMajorVersion !== undefined && input . templateMajorVersion !== null && { templateMajorVersion : input . templateMajorVersion } ) , ... ( input . templateMinorVersion !== undefined && input . templateMinorVersion !== null && { templateMinorVersion : input . templateMinorVersion } ) , } ; } ; const serializeAws_json1_0UpdateServicePipelineInput = ( input , context ) : any => { return { ... ( input . deploymentType !== undefined && input . deploymentType !== null && { deploymentType : input . deploymentType } ) , ... ( input . serviceName !== undefined && input . serviceName !== null && { serviceName : input . serviceName } ) , ... ( input . spec !== undefined && input . spec !== null && { spec : input . spec } ) , ... ( input . templateMajorVersion !== undefined && input . templateMajorVersion !== null && { templateMajorVersion : input . templateMajorVersion } ) , ... ( input . templateMinorVersion !== undefined && input . templateMinorVersion !== null && { templateMinorVersion : input . templateMinorVersion } ) , } ; } ; const serializeAws_json1_0UpdateServiceTemplateInput = ( input , context ) : any => { return { ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . displayName !== undefined && input . displayName !== null && { displayName : input . displayName } ) , ... ( input . name !== undefined && input . name !== null && { name : input . name } ) , } ; } ; const serializeAws_json1_0UpdateServiceTemplateVersionInput = ( input , context ) : any => { return { ... ( input . compatibleEnvironmentTemplates !== undefined && input . compatibleEnvironmentTemplates !== null && { compatibleEnvironmentTemplates : serializeAws_json1_0CompatibleEnvironmentTemplateInputList ( input . compatibleEnvironmentTemplates , context ) , } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , ... ( input . majorVersion !== undefined && input . majorVersion !== null && { majorVersion : input . majorVersion } ) , ... ( input . minorVersion !== undefined && input . minorVersion !== null && { minorVersion : input . minorVersion } ) , ... ( input . status !== undefined && input . status !== null && { status : input . status } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , } ; } ; const serializeAws_json1_0UpdateTemplateSyncConfigInput = ( input , context ) : any => { return { ... ( input . branch !== undefined && input . branch !== null && { branch : input . branch } ) , ... ( input . repositoryName !== undefined && input . repositoryName !== null && { repositoryName : input . repositoryName } ) , ... ( input . repositoryProvider !== undefined && input . repositoryProvider !== null && { repositoryProvider : input . repositoryProvider } ) , ... ( input . subdirectory !== undefined && input . subdirectory !== null && { subdirectory : input . subdirectory } ) , ... ( input . templateName !== undefined && input . templateName !== null && { templateName : input . templateName } ) , ... ( input . templateType !== undefined && input . templateType !== null && { templateType : input . templateType } ) , } ; } ; const deserializeAws_json1_0AcceptEnvironmentAccountConnectionOutput = ( output , context ) : AcceptEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0AccessDeniedException = ( output , context ) : AccessDeniedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0AccountSettings = ( output , context ) : AccountSettings => { return { pipelineProvisioningRepository : output . pipelineProvisioningRepository !== undefined && output . pipelineProvisioningRepository !== null ? deserializeAws_json1_0RepositoryBranch ( output . pipelineProvisioningRepository , context ) : undefined , pipelineServiceRoleArn : __expectString ( output . pipelineServiceRoleArn ) , } as any ; } ; const deserializeAws_json1_0CancelEnvironmentDeploymentOutput = ( output , context ) : CancelEnvironmentDeploymentOutput => { return { environment : output . environment !== undefined && output . environment !== null ? deserializeAws_json1_0Environment ( output . environment , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CancelServiceInstanceDeploymentOutput = ( output , context ) : CancelServiceInstanceDeploymentOutput => { return { serviceInstance : output . serviceInstance !== undefined && output . serviceInstance !== null ? deserializeAws_json1_0ServiceInstance ( output . serviceInstance , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CancelServicePipelineDeploymentOutput = ( output , context ) : CancelServicePipelineDeploymentOutput => { return { pipeline : output . pipeline !== undefined && output . pipeline !== null ? deserializeAws_json1_0ServicePipeline ( output . pipeline , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CompatibleEnvironmentTemplate = ( output , context ) : CompatibleEnvironmentTemplate => { return { majorVersion : __expectString ( output . majorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0CompatibleEnvironmentTemplateList = ( output , context ) : CompatibleEnvironmentTemplate [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0CompatibleEnvironmentTemplate ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ConflictException = ( output , context ) : ConflictException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0CreateEnvironmentAccountConnectionOutput = ( output , context ) : CreateEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateEnvironmentOutput = ( output , context ) : CreateEnvironmentOutput => { return { environment : output . environment !== undefined && output . environment !== null ? deserializeAws_json1_0Environment ( output . environment , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateEnvironmentTemplateOutput = ( output , context ) : CreateEnvironmentTemplateOutput => { return { environmentTemplate : output . environmentTemplate !== undefined && output . environmentTemplate !== null ? deserializeAws_json1_0EnvironmentTemplate ( output . environmentTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateEnvironmentTemplateVersionOutput = ( output , context ) : CreateEnvironmentTemplateVersionOutput => { return { environmentTemplateVersion : output . environmentTemplateVersion !== undefined && output . environmentTemplateVersion !== null ? deserializeAws_json1_0EnvironmentTemplateVersion ( output . environmentTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateRepositoryOutput = ( output , context ) : CreateRepositoryOutput => { return { repository : output . repository !== undefined && output . repository !== null ? deserializeAws_json1_0Repository ( output . repository , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateServiceOutput = ( output , context ) : CreateServiceOutput => { return { service : output . service !== undefined && output . service !== null ? deserializeAws_json1_0Service ( output . service , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateServiceTemplateOutput = ( output , context ) : CreateServiceTemplateOutput => { return { serviceTemplate : output . serviceTemplate !== undefined && output . serviceTemplate !== null ? deserializeAws_json1_0ServiceTemplate ( output . serviceTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateServiceTemplateVersionOutput = ( output , context ) : CreateServiceTemplateVersionOutput => { return { serviceTemplateVersion : output . serviceTemplateVersion !== undefined && output . serviceTemplateVersion !== null ? deserializeAws_json1_0ServiceTemplateVersion ( output . serviceTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0CreateTemplateSyncConfigOutput = ( output , context ) : CreateTemplateSyncConfigOutput => { return { templateSyncConfig : output . templateSyncConfig !== undefined && output . templateSyncConfig !== null ? deserializeAws_json1_0TemplateSyncConfig ( output . templateSyncConfig , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteEnvironmentAccountConnectionOutput = ( output , context ) : DeleteEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteEnvironmentOutput = ( output , context ) : DeleteEnvironmentOutput => { return { environment : output . environment !== undefined && output . environment !== null ? deserializeAws_json1_0Environment ( output . environment , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteEnvironmentTemplateOutput = ( output , context ) : DeleteEnvironmentTemplateOutput => { return { environmentTemplate : output . environmentTemplate !== undefined && output . environmentTemplate !== null ? deserializeAws_json1_0EnvironmentTemplate ( output . environmentTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteEnvironmentTemplateVersionOutput = ( output , context ) : DeleteEnvironmentTemplateVersionOutput => { return { environmentTemplateVersion : output . environmentTemplateVersion !== undefined && output . environmentTemplateVersion !== null ? deserializeAws_json1_0EnvironmentTemplateVersion ( output . environmentTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteRepositoryOutput = ( output , context ) : DeleteRepositoryOutput => { return { repository : output . repository !== undefined && output . repository !== null ? deserializeAws_json1_0Repository ( output . repository , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteServiceOutput = ( output , context ) : DeleteServiceOutput => { return { service : output . service !== undefined && output . service !== null ? deserializeAws_json1_0Service ( output . service , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteServiceTemplateOutput = ( output , context ) : DeleteServiceTemplateOutput => { return { serviceTemplate : output . serviceTemplate !== undefined && output . serviceTemplate !== null ? deserializeAws_json1_0ServiceTemplate ( output . serviceTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteServiceTemplateVersionOutput = ( output , context ) : DeleteServiceTemplateVersionOutput => { return { serviceTemplateVersion : output . serviceTemplateVersion !== undefined && output . serviceTemplateVersion !== null ? deserializeAws_json1_0ServiceTemplateVersion ( output . serviceTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0DeleteTemplateSyncConfigOutput = ( output , context ) : DeleteTemplateSyncConfigOutput => { return { templateSyncConfig : output . templateSyncConfig !== undefined && output . templateSyncConfig !== null ? deserializeAws_json1_0TemplateSyncConfig ( output . templateSyncConfig , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Environment = ( output , context ) : Environment => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentStatus : __expectString ( output . deploymentStatus ) , deploymentStatusMessage : __expectString ( output . deploymentStatusMessage ) , description : __expectString ( output . description ) , environmentAccountConnectionId : __expectString ( output . environmentAccountConnectionId ) , environmentAccountId : __expectString ( output . environmentAccountId ) , lastDeploymentAttemptedAt : output . lastDeploymentAttemptedAt !== undefined && output . lastDeploymentAttemptedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentAttemptedAt ) ) ) : undefined , lastDeploymentSucceededAt : output . lastDeploymentSucceededAt !== undefined && output . lastDeploymentSucceededAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentSucceededAt ) ) ) : undefined , name : __expectString ( output . name ) , protonServiceRoleArn : __expectString ( output . protonServiceRoleArn ) , provisioning : __expectString ( output . provisioning ) , provisioningRepository : output . provisioningRepository !== undefined && output . provisioningRepository !== null ? deserializeAws_json1_0RepositoryBranch ( output . provisioningRepository , context ) : undefined , spec : __expectString ( output . spec ) , templateMajorVersion : __expectString ( output . templateMajorVersion ) , templateMinorVersion : __expectString ( output . templateMinorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0EnvironmentAccountConnection = ( output , context ) : EnvironmentAccountConnection => { return { arn : __expectString ( output . arn ) , environmentAccountId : __expectString ( output . environmentAccountId ) , environmentName : __expectString ( output . environmentName ) , id : __expectString ( output . id ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , managementAccountId : __expectString ( output . managementAccountId ) , requestedAt : output . requestedAt !== undefined && output . requestedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . requestedAt ) ) ) : undefined , roleArn : __expectString ( output . roleArn ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_0EnvironmentAccountConnectionSummary = ( output , context ) : EnvironmentAccountConnectionSummary => { return { arn : __expectString ( output . arn ) , environmentAccountId : __expectString ( output . environmentAccountId ) , environmentName : __expectString ( output . environmentName ) , id : __expectString ( output . id ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , managementAccountId : __expectString ( output . managementAccountId ) , requestedAt : output . requestedAt !== undefined && output . requestedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . requestedAt ) ) ) : undefined , roleArn : __expectString ( output . roleArn ) , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_0EnvironmentAccountConnectionSummaryList = ( output , context ) : EnvironmentAccountConnectionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0EnvironmentAccountConnectionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0EnvironmentSummary = ( output , context ) : EnvironmentSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentStatus : __expectString ( output . deploymentStatus ) , deploymentStatusMessage : __expectString ( output . deploymentStatusMessage ) , description : __expectString ( output . description ) , environmentAccountConnectionId : __expectString ( output . environmentAccountConnectionId ) , environmentAccountId : __expectString ( output . environmentAccountId ) , lastDeploymentAttemptedAt : output . lastDeploymentAttemptedAt !== undefined && output . lastDeploymentAttemptedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentAttemptedAt ) ) ) : undefined , lastDeploymentSucceededAt : output . lastDeploymentSucceededAt !== undefined && output . lastDeploymentSucceededAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentSucceededAt ) ) ) : undefined , name : __expectString ( output . name ) , protonServiceRoleArn : __expectString ( output . protonServiceRoleArn ) , provisioning : __expectString ( output . provisioning ) , templateMajorVersion : __expectString ( output . templateMajorVersion ) , templateMinorVersion : __expectString ( output . templateMinorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0EnvironmentSummaryList = ( output , context ) : EnvironmentSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0EnvironmentSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0EnvironmentTemplate = ( output , context ) : EnvironmentTemplate => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , displayName : __expectString ( output . displayName ) , encryptionKey : __expectString ( output . encryptionKey ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , provisioning : __expectString ( output . provisioning ) , recommendedVersion : __expectString ( output . recommendedVersion ) , } as any ; } ; const deserializeAws_json1_0EnvironmentTemplateSummary = ( output , context ) : EnvironmentTemplateSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , displayName : __expectString ( output . displayName ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , provisioning : __expectString ( output . provisioning ) , recommendedVersion : __expectString ( output . recommendedVersion ) , } as any ; } ; const deserializeAws_json1_0EnvironmentTemplateSummaryList = ( output , context ) : EnvironmentTemplateSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0EnvironmentTemplateSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0EnvironmentTemplateVersion = ( output , context ) : EnvironmentTemplateVersion => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , majorVersion : __expectString ( output . majorVersion ) , minorVersion : __expectString ( output . minorVersion ) , recommendedMinorVersion : __expectString ( output . recommendedMinorVersion ) , schema : __expectString ( output . schema ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0EnvironmentTemplateVersionSummary = ( output , context ) : EnvironmentTemplateVersionSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , majorVersion : __expectString ( output . majorVersion ) , minorVersion : __expectString ( output . minorVersion ) , recommendedMinorVersion : __expectString ( output . recommendedMinorVersion ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0EnvironmentTemplateVersionSummaryList = ( output , context ) : EnvironmentTemplateVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0EnvironmentTemplateVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0GetAccountSettingsOutput = ( output , context ) : GetAccountSettingsOutput => { return { accountSettings : output . accountSettings !== undefined && output . accountSettings !== null ? deserializeAws_json1_0AccountSettings ( output . accountSettings , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetEnvironmentAccountConnectionOutput = ( output , context ) : GetEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetEnvironmentOutput = ( output , context ) : GetEnvironmentOutput => { return { environment : output . environment !== undefined && output . environment !== null ? deserializeAws_json1_0Environment ( output . environment , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetEnvironmentTemplateOutput = ( output , context ) : GetEnvironmentTemplateOutput => { return { environmentTemplate : output . environmentTemplate !== undefined && output . environmentTemplate !== null ? deserializeAws_json1_0EnvironmentTemplate ( output . environmentTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetEnvironmentTemplateVersionOutput = ( output , context ) : GetEnvironmentTemplateVersionOutput => { return { environmentTemplateVersion : output . environmentTemplateVersion !== undefined && output . environmentTemplateVersion !== null ? deserializeAws_json1_0EnvironmentTemplateVersion ( output . environmentTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetRepositoryOutput = ( output , context ) : GetRepositoryOutput => { return { repository : output . repository !== undefined && output . repository !== null ? deserializeAws_json1_0Repository ( output . repository , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetRepositorySyncStatusOutput = ( output , context ) : GetRepositorySyncStatusOutput => { return { latestSync : output . latestSync !== undefined && output . latestSync !== null ? deserializeAws_json1_0RepositorySyncAttempt ( output . latestSync , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetServiceInstanceOutput = ( output , context ) : GetServiceInstanceOutput => { return { serviceInstance : output . serviceInstance !== undefined && output . serviceInstance !== null ? deserializeAws_json1_0ServiceInstance ( output . serviceInstance , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetServiceOutput = ( output , context ) : GetServiceOutput => { return { service : output . service !== undefined && output . service !== null ? deserializeAws_json1_0Service ( output . service , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetServiceTemplateOutput = ( output , context ) : GetServiceTemplateOutput => { return { serviceTemplate : output . serviceTemplate !== undefined && output . serviceTemplate !== null ? deserializeAws_json1_0ServiceTemplate ( output . serviceTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetServiceTemplateVersionOutput = ( output , context ) : GetServiceTemplateVersionOutput => { return { serviceTemplateVersion : output . serviceTemplateVersion !== undefined && output . serviceTemplateVersion !== null ? deserializeAws_json1_0ServiceTemplateVersion ( output . serviceTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetTemplateSyncConfigOutput = ( output , context ) : GetTemplateSyncConfigOutput => { return { templateSyncConfig : output . templateSyncConfig !== undefined && output . templateSyncConfig !== null ? deserializeAws_json1_0TemplateSyncConfig ( output . templateSyncConfig , context ) : undefined , } as any ; } ; const deserializeAws_json1_0GetTemplateSyncStatusOutput = ( output , context ) : GetTemplateSyncStatusOutput => { return { desiredState : output . desiredState !== undefined && output . desiredState !== null ? deserializeAws_json1_0Revision ( output . desiredState , context ) : undefined , latestSuccessfulSync : output . latestSuccessfulSync !== undefined && output . latestSuccessfulSync !== null ? deserializeAws_json1_0ResourceSyncAttempt ( output . latestSuccessfulSync , context ) : undefined , latestSync : output . latestSync !== undefined && output . latestSync !== null ? deserializeAws_json1_0ResourceSyncAttempt ( output . latestSync , context ) : undefined , } as any ; } ; const deserializeAws_json1_0InternalServerException = ( output , context ) : InternalServerException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ListEnvironmentAccountConnectionsOutput = ( output , context ) : ListEnvironmentAccountConnectionsOutput => { return { environmentAccountConnections : output . environmentAccountConnections !== undefined && output . environmentAccountConnections !== null ? deserializeAws_json1_0EnvironmentAccountConnectionSummaryList ( output . environmentAccountConnections , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_0ListEnvironmentOutputsOutput = ( output , context ) : ListEnvironmentOutputsOutput => { return { nextToken : __expectString ( output . nextToken ) , outputs : output . outputs !== undefined && output . outputs !== null ? deserializeAws_json1_0OutputsList ( output . outputs , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListEnvironmentProvisionedResourcesOutput = ( output , context ) : ListEnvironmentProvisionedResourcesOutput => { return { nextToken : __expectString ( output . nextToken ) , provisionedResources : output . provisionedResources !== undefined && output . provisionedResources !== null ? deserializeAws_json1_0ProvisionedResourceList ( output . provisionedResources , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListEnvironmentsOutput = ( output , context ) : ListEnvironmentsOutput => { return { environments : output . environments !== undefined && output . environments !== null ? deserializeAws_json1_0EnvironmentSummaryList ( output . environments , context ) : undefined , nextToken : __expectString ( output . nextToken ) , } as any ; } ; const deserializeAws_json1_0ListEnvironmentTemplatesOutput = ( output , context ) : ListEnvironmentTemplatesOutput => { return { nextToken : __expectString ( output . nextToken ) , templates : output . templates !== undefined && output . templates !== null ? deserializeAws_json1_0EnvironmentTemplateSummaryList ( output . templates , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListEnvironmentTemplateVersionsOutput = ( output , context ) : ListEnvironmentTemplateVersionsOutput => { return { nextToken : __expectString ( output . nextToken ) , templateVersions : output . templateVersions !== undefined && output . templateVersions !== null ? deserializeAws_json1_0EnvironmentTemplateVersionSummaryList ( output . templateVersions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListRepositoriesOutput = ( output , context ) : ListRepositoriesOutput => { return { nextToken : __expectString ( output . nextToken ) , repositories : output . repositories !== undefined && output . repositories !== null ? deserializeAws_json1_0RepositorySummaryList ( output . repositories , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListRepositorySyncDefinitionsOutput = ( output , context ) : ListRepositorySyncDefinitionsOutput => { return { nextToken : __expectString ( output . nextToken ) , syncDefinitions : output . syncDefinitions !== undefined && output . syncDefinitions !== null ? deserializeAws_json1_0RepositorySyncDefinitionList ( output . syncDefinitions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServiceInstanceOutputsOutput = ( output , context ) : ListServiceInstanceOutputsOutput => { return { nextToken : __expectString ( output . nextToken ) , outputs : output . outputs !== undefined && output . outputs !== null ? deserializeAws_json1_0OutputsList ( output . outputs , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServiceInstanceProvisionedResourcesOutput = ( output , context ) : ListServiceInstanceProvisionedResourcesOutput => { return { nextToken : __expectString ( output . nextToken ) , provisionedResources : output . provisionedResources !== undefined && output . provisionedResources !== null ? deserializeAws_json1_0ProvisionedResourceList ( output . provisionedResources , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServiceInstancesOutput = ( output , context ) : ListServiceInstancesOutput => { return { nextToken : __expectString ( output . nextToken ) , serviceInstances : output . serviceInstances !== undefined && output . serviceInstances !== null ? deserializeAws_json1_0ServiceInstanceSummaryList ( output . serviceInstances , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServicePipelineOutputsOutput = ( output , context ) : ListServicePipelineOutputsOutput => { return { nextToken : __expectString ( output . nextToken ) , outputs : output . outputs !== undefined && output . outputs !== null ? deserializeAws_json1_0OutputsList ( output . outputs , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServicePipelineProvisionedResourcesOutput = ( output , context ) : ListServicePipelineProvisionedResourcesOutput => { return { nextToken : __expectString ( output . nextToken ) , provisionedResources : output . provisionedResources !== undefined && output . provisionedResources !== null ? deserializeAws_json1_0ProvisionedResourceList ( output . provisionedResources , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServicesOutput = ( output , context ) : ListServicesOutput => { return { nextToken : __expectString ( output . nextToken ) , services : output . services !== undefined && output . services !== null ? deserializeAws_json1_0ServiceSummaryList ( output . services , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServiceTemplatesOutput = ( output , context ) : ListServiceTemplatesOutput => { return { nextToken : __expectString ( output . nextToken ) , templates : output . templates !== undefined && output . templates !== null ? deserializeAws_json1_0ServiceTemplateSummaryList ( output . templates , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListServiceTemplateVersionsOutput = ( output , context ) : ListServiceTemplateVersionsOutput => { return { nextToken : __expectString ( output . nextToken ) , templateVersions : output . templateVersions !== undefined && output . templateVersions !== null ? deserializeAws_json1_0ServiceTemplateVersionSummaryList ( output . templateVersions , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ListTagsForResourceOutput = ( output , context ) : ListTagsForResourceOutput => { return { nextToken : __expectString ( output . nextToken ) , tags : output . tags !== undefined && output . tags !== null ? deserializeAws_json1_0TagList ( output . tags , context ) : undefined , } as any ; } ; const deserializeAws_json1_0NotifyResourceDeploymentStatusChangeOutput = ( output , context ) : NotifyResourceDeploymentStatusChangeOutput => { return { } as any ; } ; const deserializeAws_json1_0Output = ( output , context ) : Output => { return { key : __expectString ( output . key ) , valueString : __expectString ( output . valueString ) , } as any ; } ; const deserializeAws_json1_0OutputsList = ( output , context ) : Output [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Output ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ProvisionedResource = ( output , context ) : ProvisionedResource => { return { identifier : __expectString ( output . identifier ) , name : __expectString ( output . name ) , provisioningEngine : __expectString ( output . provisioningEngine ) , } as any ; } ; const deserializeAws_json1_0ProvisionedResourceList = ( output , context ) : ProvisionedResource [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ProvisionedResource ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0RejectEnvironmentAccountConnectionOutput = ( output , context ) : RejectEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0Repository = ( output , context ) : Repository => { return { arn : __expectString ( output . arn ) , connectionArn : __expectString ( output . connectionArn ) , encryptionKey : __expectString ( output . encryptionKey ) , name : __expectString ( output . name ) , provider : __expectString ( output . provider ) , } as any ; } ; const deserializeAws_json1_0RepositoryBranch = ( output , context ) : RepositoryBranch => { return { arn : __expectString ( output . arn ) , branch : __expectString ( output . branch ) , name : __expectString ( output . name ) , provider : __expectString ( output . provider ) , } as any ; } ; const deserializeAws_json1_0RepositorySummary = ( output , context ) : RepositorySummary => { return { arn : __expectString ( output . arn ) , name : __expectString ( output . name ) , provider : __expectString ( output . provider ) , } as any ; } ; const deserializeAws_json1_0RepositorySummaryList = ( output , context ) : RepositorySummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0RepositorySummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0RepositorySyncAttempt = ( output , context ) : RepositorySyncAttempt => { return { events : output . events !== undefined && output . events !== null ? deserializeAws_json1_0RepositorySyncEvents ( output . events , context ) : undefined , startedAt : output . startedAt !== undefined && output . startedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startedAt ) ) ) : undefined , status : __expectString ( output . status ) , } as any ; } ; const deserializeAws_json1_0RepositorySyncDefinition = ( output , context ) : RepositorySyncDefinition => { return { branch : __expectString ( output . branch ) , directory : __expectString ( output . directory ) , parent : __expectString ( output . parent ) , target : __expectString ( output . target ) , } as any ; } ; const deserializeAws_json1_0RepositorySyncDefinitionList = ( output , context ) : RepositorySyncDefinition [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0RepositorySyncDefinition ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0RepositorySyncEvent = ( output , context ) : RepositorySyncEvent => { return { event : __expectString ( output . event ) , externalId : __expectString ( output . externalId ) , time : output . time !== undefined && output . time !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . time ) ) ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_0RepositorySyncEvents = ( output , context ) : RepositorySyncEvent [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0RepositorySyncEvent ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ResourceSyncAttempt = ( output , context ) : ResourceSyncAttempt => { return { events : output . events !== undefined && output . events !== null ? deserializeAws_json1_0ResourceSyncEvents ( output . events , context ) : undefined , initialRevision : output . initialRevision !== undefined && output . initialRevision !== null ? deserializeAws_json1_0Revision ( output . initialRevision , context ) : undefined , startedAt : output . startedAt !== undefined && output . startedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . startedAt ) ) ) : undefined , status : __expectString ( output . status ) , target : __expectString ( output . target ) , targetRevision : output . targetRevision !== undefined && output . targetRevision !== null ? deserializeAws_json1_0Revision ( output . targetRevision , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ResourceSyncEvent = ( output , context ) : ResourceSyncEvent => { return { event : __expectString ( output . event ) , externalId : __expectString ( output . externalId ) , time : output . time !== undefined && output . time !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . time ) ) ) : undefined , type : __expectString ( output . type ) , } as any ; } ; const deserializeAws_json1_0ResourceSyncEvents = ( output , context ) : ResourceSyncEvent [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ResourceSyncEvent ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0Revision = ( output , context ) : Revision => { return { branch : __expectString ( output . branch ) , directory : __expectString ( output . directory ) , repositoryName : __expectString ( output . repositoryName ) , repositoryProvider : __expectString ( output . repositoryProvider ) , sha : __expectString ( output . sha ) , } as any ; } ; const deserializeAws_json1_0Service = ( output , context ) : Service => { return { arn : __expectString ( output . arn ) , branchName : __expectString ( output . branchName ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , pipeline : output . pipeline !== undefined && output . pipeline !== null ? deserializeAws_json1_0ServicePipeline ( output . pipeline , context ) : undefined , repositoryConnectionArn : __expectString ( output . repositoryConnectionArn ) , repositoryId : __expectString ( output . repositoryId ) , spec : __expectString ( output . spec ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceInstance = ( output , context ) : ServiceInstance => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentStatus : __expectString ( output . deploymentStatus ) , deploymentStatusMessage : __expectString ( output . deploymentStatusMessage ) , environmentName : __expectString ( output . environmentName ) , lastDeploymentAttemptedAt : output . lastDeploymentAttemptedAt !== undefined && output . lastDeploymentAttemptedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentAttemptedAt ) ) ) : undefined , lastDeploymentSucceededAt : output . lastDeploymentSucceededAt !== undefined && output . lastDeploymentSucceededAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentSucceededAt ) ) ) : undefined , name : __expectString ( output . name ) , serviceName : __expectString ( output . serviceName ) , spec : __expectString ( output . spec ) , templateMajorVersion : __expectString ( output . templateMajorVersion ) , templateMinorVersion : __expectString ( output . templateMinorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceInstanceSummary = ( output , context ) : ServiceInstanceSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentStatus : __expectString ( output . deploymentStatus ) , deploymentStatusMessage : __expectString ( output . deploymentStatusMessage ) , environmentName : __expectString ( output . environmentName ) , lastDeploymentAttemptedAt : output . lastDeploymentAttemptedAt !== undefined && output . lastDeploymentAttemptedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentAttemptedAt ) ) ) : undefined , lastDeploymentSucceededAt : output . lastDeploymentSucceededAt !== undefined && output . lastDeploymentSucceededAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentSucceededAt ) ) ) : undefined , name : __expectString ( output . name ) , serviceName : __expectString ( output . serviceName ) , templateMajorVersion : __expectString ( output . templateMajorVersion ) , templateMinorVersion : __expectString ( output . templateMinorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceInstanceSummaryList = ( output , context ) : ServiceInstanceSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ServiceInstanceSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ServicePipeline = ( output , context ) : ServicePipeline => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , deploymentStatus : __expectString ( output . deploymentStatus ) , deploymentStatusMessage : __expectString ( output . deploymentStatusMessage ) , lastDeploymentAttemptedAt : output . lastDeploymentAttemptedAt !== undefined && output . lastDeploymentAttemptedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentAttemptedAt ) ) ) : undefined , lastDeploymentSucceededAt : output . lastDeploymentSucceededAt !== undefined && output . lastDeploymentSucceededAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastDeploymentSucceededAt ) ) ) : undefined , spec : __expectString ( output . spec ) , templateMajorVersion : __expectString ( output . templateMajorVersion ) , templateMinorVersion : __expectString ( output . templateMinorVersion ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceQuotaExceededException = ( output , context ) : ServiceQuotaExceededException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0ServiceSummary = ( output , context ) : ServiceSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceSummaryList = ( output , context ) : ServiceSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ServiceSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ServiceTemplate = ( output , context ) : ServiceTemplate => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , displayName : __expectString ( output . displayName ) , encryptionKey : __expectString ( output . encryptionKey ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , pipelineProvisioning : __expectString ( output . pipelineProvisioning ) , recommendedVersion : __expectString ( output . recommendedVersion ) , } as any ; } ; const deserializeAws_json1_0ServiceTemplateSummary = ( output , context ) : ServiceTemplateSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , displayName : __expectString ( output . displayName ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , name : __expectString ( output . name ) , pipelineProvisioning : __expectString ( output . pipelineProvisioning ) , recommendedVersion : __expectString ( output . recommendedVersion ) , } as any ; } ; const deserializeAws_json1_0ServiceTemplateSummaryList = ( output , context ) : ServiceTemplateSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ServiceTemplateSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0ServiceTemplateVersion = ( output , context ) : ServiceTemplateVersion => { return { arn : __expectString ( output . arn ) , compatibleEnvironmentTemplates : output . compatibleEnvironmentTemplates !== undefined && output . compatibleEnvironmentTemplates !== null ? deserializeAws_json1_0CompatibleEnvironmentTemplateList ( output . compatibleEnvironmentTemplates , context ) : undefined , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , majorVersion : __expectString ( output . majorVersion ) , minorVersion : __expectString ( output . minorVersion ) , recommendedMinorVersion : __expectString ( output . recommendedMinorVersion ) , schema : __expectString ( output . schema ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceTemplateVersionSummary = ( output , context ) : ServiceTemplateVersionSummary => { return { arn : __expectString ( output . arn ) , createdAt : output . createdAt !== undefined && output . createdAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . createdAt ) ) ) : undefined , description : __expectString ( output . description ) , lastModifiedAt : output . lastModifiedAt !== undefined && output . lastModifiedAt !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . lastModifiedAt ) ) ) : undefined , majorVersion : __expectString ( output . majorVersion ) , minorVersion : __expectString ( output . minorVersion ) , recommendedMinorVersion : __expectString ( output . recommendedMinorVersion ) , status : __expectString ( output . status ) , statusMessage : __expectString ( output . statusMessage ) , templateName : __expectString ( output . templateName ) , } as any ; } ; const deserializeAws_json1_0ServiceTemplateVersionSummaryList = ( output , context ) : ServiceTemplateVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0ServiceTemplateVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0Tag = ( output , context ) : Tag => { return { key : __expectString ( output . key ) , value : __expectString ( output . value ) , } as any ; } ; const deserializeAws_json1_0TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_0Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_0TagResourceOutput = ( output , context ) : TagResourceOutput => { return { } as any ; } ; const deserializeAws_json1_0TemplateSyncConfig = ( output , context ) : TemplateSyncConfig => { return { branch : __expectString ( output . branch ) , repositoryName : __expectString ( output . repositoryName ) , repositoryProvider : __expectString ( output . repositoryProvider ) , subdirectory : __expectString ( output . subdirectory ) , templateName : __expectString ( output . templateName ) , templateType : __expectString ( output . templateType ) , } as any ; } ; const deserializeAws_json1_0ThrottlingException = ( output , context ) : ThrottlingException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_0UntagResourceOutput = ( output , context ) : UntagResourceOutput => { return { } as any ; } ; const deserializeAws_json1_0UpdateAccountSettingsOutput = ( output , context ) : UpdateAccountSettingsOutput => { return { accountSettings : output . accountSettings !== undefined && output . accountSettings !== null ? deserializeAws_json1_0AccountSettings ( output . accountSettings , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateEnvironmentAccountConnectionOutput = ( output , context ) : UpdateEnvironmentAccountConnectionOutput => { return { environmentAccountConnection : output . environmentAccountConnection !== undefined && output . environmentAccountConnection !== null ? deserializeAws_json1_0EnvironmentAccountConnection ( output . environmentAccountConnection , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateEnvironmentOutput = ( output , context ) : UpdateEnvironmentOutput => { return { environment : output . environment !== undefined && output . environment !== null ? deserializeAws_json1_0Environment ( output . environment , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateEnvironmentTemplateOutput = ( output , context ) : UpdateEnvironmentTemplateOutput => { return { environmentTemplate : output . environmentTemplate !== undefined && output . environmentTemplate !== null ? deserializeAws_json1_0EnvironmentTemplate ( output . environmentTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateEnvironmentTemplateVersionOutput = ( output , context ) : UpdateEnvironmentTemplateVersionOutput => { return { environmentTemplateVersion : output . environmentTemplateVersion !== undefined && output . environmentTemplateVersion !== null ? deserializeAws_json1_0EnvironmentTemplateVersion ( output . environmentTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateServiceInstanceOutput = ( output , context ) : UpdateServiceInstanceOutput => { return { serviceInstance : output . serviceInstance !== undefined && output . serviceInstance !== null ? deserializeAws_json1_0ServiceInstance ( output . serviceInstance , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateServiceOutput = ( output , context ) : UpdateServiceOutput => { return { service : output . service !== undefined && output . service !== null ? deserializeAws_json1_0Service ( output . service , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateServicePipelineOutput = ( output , context ) : UpdateServicePipelineOutput => { return { pipeline : output . pipeline !== undefined && output . pipeline !== null ? deserializeAws_json1_0ServicePipeline ( output . pipeline , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateServiceTemplateOutput = ( output , context ) : UpdateServiceTemplateOutput => { return { serviceTemplate : output . serviceTemplate !== undefined && output . serviceTemplate !== null ? deserializeAws_json1_0ServiceTemplate ( output . serviceTemplate , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateServiceTemplateVersionOutput = ( output , context ) : UpdateServiceTemplateVersionOutput => { return { serviceTemplateVersion : output . serviceTemplateVersion !== undefined && output . serviceTemplateVersion !== null ? deserializeAws_json1_0ServiceTemplateVersion ( output . serviceTemplateVersion , context ) : undefined , } as any ; } ; const deserializeAws_json1_0UpdateTemplateSyncConfigOutput = ( output , context ) : UpdateTemplateSyncConfigOutput => { return { templateSyncConfig : output . templateSyncConfig !== undefined && output . templateSyncConfig !== null ? deserializeAws_json1_0TemplateSyncConfig ( output . templateSyncConfig , context ) : undefined , } as any ; } ; const deserializeAws_json1_0ValidationException = ( output , context ) : ValidationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;