import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , 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 { AssociateConnectionAliasCommandInput , AssociateConnectionAliasCommandOutput , } from "../commands/AssociateConnectionAliasCommand" ; import { AssociateIpGroupsCommandInput , AssociateIpGroupsCommandOutput } from "../commands/AssociateIpGroupsCommand" ; import { AuthorizeIpRulesCommandInput , AuthorizeIpRulesCommandOutput } from "../commands/AuthorizeIpRulesCommand" ; import { CopyWorkspaceImageCommandInput , CopyWorkspaceImageCommandOutput } from "../commands/CopyWorkspaceImageCommand" ; import { CreateConnectionAliasCommandInput , CreateConnectionAliasCommandOutput , } from "../commands/CreateConnectionAliasCommand" ; import { CreateIpGroupCommandInput , CreateIpGroupCommandOutput } from "../commands/CreateIpGroupCommand" ; import { CreateTagsCommandInput , CreateTagsCommandOutput } from "../commands/CreateTagsCommand" ; import { CreateUpdatedWorkspaceImageCommandInput , CreateUpdatedWorkspaceImageCommandOutput , } from "../commands/CreateUpdatedWorkspaceImageCommand" ; import { CreateWorkspaceBundleCommandInput , CreateWorkspaceBundleCommandOutput , } from "../commands/CreateWorkspaceBundleCommand" ; import { CreateWorkspacesCommandInput , CreateWorkspacesCommandOutput } from "../commands/CreateWorkspacesCommand" ; import { DeleteConnectionAliasCommandInput , DeleteConnectionAliasCommandOutput , } from "../commands/DeleteConnectionAliasCommand" ; import { DeleteIpGroupCommandInput , DeleteIpGroupCommandOutput } from "../commands/DeleteIpGroupCommand" ; import { DeleteTagsCommandInput , DeleteTagsCommandOutput } from "../commands/DeleteTagsCommand" ; import { DeleteWorkspaceBundleCommandInput , DeleteWorkspaceBundleCommandOutput , } from "../commands/DeleteWorkspaceBundleCommand" ; import { DeleteWorkspaceImageCommandInput , DeleteWorkspaceImageCommandOutput , } from "../commands/DeleteWorkspaceImageCommand" ; import { DeregisterWorkspaceDirectoryCommandInput , DeregisterWorkspaceDirectoryCommandOutput , } from "../commands/DeregisterWorkspaceDirectoryCommand" ; import { DescribeAccountCommandInput , DescribeAccountCommandOutput } from "../commands/DescribeAccountCommand" ; import { DescribeAccountModificationsCommandInput , DescribeAccountModificationsCommandOutput , } from "../commands/DescribeAccountModificationsCommand" ; import { DescribeClientPropertiesCommandInput , DescribeClientPropertiesCommandOutput , } from "../commands/DescribeClientPropertiesCommand" ; import { DescribeConnectionAliasesCommandInput , DescribeConnectionAliasesCommandOutput , } from "../commands/DescribeConnectionAliasesCommand" ; import { DescribeConnectionAliasPermissionsCommandInput , DescribeConnectionAliasPermissionsCommandOutput , } from "../commands/DescribeConnectionAliasPermissionsCommand" ; import { DescribeIpGroupsCommandInput , DescribeIpGroupsCommandOutput } from "../commands/DescribeIpGroupsCommand" ; import { DescribeTagsCommandInput , DescribeTagsCommandOutput } from "../commands/DescribeTagsCommand" ; import { DescribeWorkspaceBundlesCommandInput , DescribeWorkspaceBundlesCommandOutput , } from "../commands/DescribeWorkspaceBundlesCommand" ; import { DescribeWorkspaceDirectoriesCommandInput , DescribeWorkspaceDirectoriesCommandOutput , } from "../commands/DescribeWorkspaceDirectoriesCommand" ; import { DescribeWorkspaceImagePermissionsCommandInput , DescribeWorkspaceImagePermissionsCommandOutput , } from "../commands/DescribeWorkspaceImagePermissionsCommand" ; import { DescribeWorkspaceImagesCommandInput , DescribeWorkspaceImagesCommandOutput , } from "../commands/DescribeWorkspaceImagesCommand" ; import { DescribeWorkspacesCommandInput , DescribeWorkspacesCommandOutput } from "../commands/DescribeWorkspacesCommand" ; import { DescribeWorkspacesConnectionStatusCommandInput , DescribeWorkspacesConnectionStatusCommandOutput , } from "../commands/DescribeWorkspacesConnectionStatusCommand" ; import { DescribeWorkspaceSnapshotsCommandInput , DescribeWorkspaceSnapshotsCommandOutput , } from "../commands/DescribeWorkspaceSnapshotsCommand" ; import { DisassociateConnectionAliasCommandInput , DisassociateConnectionAliasCommandOutput , } from "../commands/DisassociateConnectionAliasCommand" ; import { DisassociateIpGroupsCommandInput , DisassociateIpGroupsCommandOutput , } from "../commands/DisassociateIpGroupsCommand" ; import { ImportWorkspaceImageCommandInput , ImportWorkspaceImageCommandOutput , } from "../commands/ImportWorkspaceImageCommand" ; import { ListAvailableManagementCidrRangesCommandInput , ListAvailableManagementCidrRangesCommandOutput , } from "../commands/ListAvailableManagementCidrRangesCommand" ; import { MigrateWorkspaceCommandInput , MigrateWorkspaceCommandOutput } from "../commands/MigrateWorkspaceCommand" ; import { ModifyAccountCommandInput , ModifyAccountCommandOutput } from "../commands/ModifyAccountCommand" ; import { ModifyClientPropertiesCommandInput , ModifyClientPropertiesCommandOutput , } from "../commands/ModifyClientPropertiesCommand" ; import { ModifySelfservicePermissionsCommandInput , ModifySelfservicePermissionsCommandOutput , } from "../commands/ModifySelfservicePermissionsCommand" ; import { ModifyWorkspaceAccessPropertiesCommandInput , ModifyWorkspaceAccessPropertiesCommandOutput , } from "../commands/ModifyWorkspaceAccessPropertiesCommand" ; import { ModifyWorkspaceCreationPropertiesCommandInput , ModifyWorkspaceCreationPropertiesCommandOutput , } from "../commands/ModifyWorkspaceCreationPropertiesCommand" ; import { ModifyWorkspacePropertiesCommandInput , ModifyWorkspacePropertiesCommandOutput , } from "../commands/ModifyWorkspacePropertiesCommand" ; import { ModifyWorkspaceStateCommandInput , ModifyWorkspaceStateCommandOutput , } from "../commands/ModifyWorkspaceStateCommand" ; import { RebootWorkspacesCommandInput , RebootWorkspacesCommandOutput } from "../commands/RebootWorkspacesCommand" ; import { RebuildWorkspacesCommandInput , RebuildWorkspacesCommandOutput } from "../commands/RebuildWorkspacesCommand" ; import { RegisterWorkspaceDirectoryCommandInput , RegisterWorkspaceDirectoryCommandOutput , } from "../commands/RegisterWorkspaceDirectoryCommand" ; import { RestoreWorkspaceCommandInput , RestoreWorkspaceCommandOutput } from "../commands/RestoreWorkspaceCommand" ; import { RevokeIpRulesCommandInput , RevokeIpRulesCommandOutput } from "../commands/RevokeIpRulesCommand" ; import { StartWorkspacesCommandInput , StartWorkspacesCommandOutput } from "../commands/StartWorkspacesCommand" ; import { StopWorkspacesCommandInput , StopWorkspacesCommandOutput } from "../commands/StopWorkspacesCommand" ; import { TerminateWorkspacesCommandInput , TerminateWorkspacesCommandOutput , } from "../commands/TerminateWorkspacesCommand" ; import { UpdateConnectionAliasPermissionCommandInput , UpdateConnectionAliasPermissionCommandOutput , } from "../commands/UpdateConnectionAliasPermissionCommand" ; import { UpdateRulesOfIpGroupCommandInput , UpdateRulesOfIpGroupCommandOutput , } from "../commands/UpdateRulesOfIpGroupCommand" ; import { UpdateWorkspaceBundleCommandInput , UpdateWorkspaceBundleCommandOutput , } from "../commands/UpdateWorkspaceBundleCommand" ; import { UpdateWorkspaceImagePermissionCommandInput , UpdateWorkspaceImagePermissionCommandOutput , } from "../commands/UpdateWorkspaceImagePermissionCommand" ; import { AccessDeniedException , AccountModification , Application , AssociateConnectionAliasRequest , AssociateConnectionAliasResult , AssociateIpGroupsRequest , AssociateIpGroupsResult , AuthorizeIpRulesRequest , AuthorizeIpRulesResult , ClientProperties , ClientPropertiesResult , ComputeType , ConnectionAlias , ConnectionAliasAssociation , ConnectionAliasPermission , CopyWorkspaceImageRequest , CopyWorkspaceImageResult , CreateConnectionAliasRequest , CreateConnectionAliasResult , CreateIpGroupRequest , CreateIpGroupResult , CreateTagsRequest , CreateTagsResult , CreateUpdatedWorkspaceImageRequest , CreateUpdatedWorkspaceImageResult , CreateWorkspaceBundleRequest , CreateWorkspaceBundleResult , CreateWorkspacesRequest , CreateWorkspacesResult , DefaultWorkspaceCreationProperties , DeleteConnectionAliasRequest , DeleteConnectionAliasResult , DeleteIpGroupRequest , DeleteIpGroupResult , DeleteTagsRequest , DeleteTagsResult , DeleteWorkspaceBundleRequest , DeleteWorkspaceBundleResult , DeleteWorkspaceImageRequest , DeleteWorkspaceImageResult , DeregisterWorkspaceDirectoryRequest , DeregisterWorkspaceDirectoryResult , DescribeAccountModificationsRequest , DescribeAccountModificationsResult , DescribeAccountRequest , DescribeAccountResult , DescribeClientPropertiesRequest , DescribeClientPropertiesResult , DescribeConnectionAliasesRequest , DescribeConnectionAliasesResult , DescribeConnectionAliasPermissionsRequest , DescribeConnectionAliasPermissionsResult , DescribeIpGroupsRequest , DescribeIpGroupsResult , DescribeTagsRequest , DescribeTagsResult , DescribeWorkspaceBundlesRequest , DescribeWorkspaceBundlesResult , DescribeWorkspaceDirectoriesRequest , DescribeWorkspaceDirectoriesResult , DescribeWorkspaceImagePermissionsRequest , DescribeWorkspaceImagePermissionsResult , DescribeWorkspaceImagesRequest , DescribeWorkspaceImagesResult , DescribeWorkspacesConnectionStatusRequest , DescribeWorkspacesConnectionStatusResult , DescribeWorkspaceSnapshotsRequest , DescribeWorkspaceSnapshotsResult , DescribeWorkspacesRequest , DescribeWorkspacesResult , DisassociateConnectionAliasRequest , DisassociateConnectionAliasResult , DisassociateIpGroupsRequest , DisassociateIpGroupsResult , FailedCreateWorkspaceRequest , FailedWorkspaceChangeRequest , ImagePermission , ImportWorkspaceImageRequest , ImportWorkspaceImageResult , InvalidParameterValuesException , InvalidResourceStateException , IpRuleItem , ListAvailableManagementCidrRangesRequest , ListAvailableManagementCidrRangesResult , MigrateWorkspaceRequest , MigrateWorkspaceResult , ModificationState , ModifyAccountRequest , ModifyAccountResult , ModifyClientPropertiesRequest , ModifyClientPropertiesResult , ModifySelfservicePermissionsRequest , ModifySelfservicePermissionsResult , ModifyWorkspaceAccessPropertiesRequest , ModifyWorkspaceAccessPropertiesResult , ModifyWorkspaceCreationPropertiesRequest , ModifyWorkspaceCreationPropertiesResult , ModifyWorkspacePropertiesRequest , ModifyWorkspacePropertiesResult , ModifyWorkspaceStateRequest , ModifyWorkspaceStateResult , OperatingSystem , OperationInProgressException , OperationNotSupportedException , RebootRequest , RebootWorkspacesRequest , RebootWorkspacesResult , RebuildRequest , RebuildWorkspacesRequest , RebuildWorkspacesResult , RegisterWorkspaceDirectoryRequest , RegisterWorkspaceDirectoryResult , ResourceAlreadyExistsException , ResourceAssociatedException , ResourceCreationFailedException , ResourceLimitExceededException , ResourceNotFoundException , ResourceUnavailableException , RestoreWorkspaceRequest , RestoreWorkspaceResult , RevokeIpRulesRequest , RevokeIpRulesResult , RootStorage , SelfservicePermissions , Snapshot , StartRequest , StartWorkspacesRequest , StartWorkspacesResult , StopRequest , StopWorkspacesRequest , StopWorkspacesResult , Tag , TerminateRequest , TerminateWorkspacesRequest , TerminateWorkspacesResult , UnsupportedNetworkConfigurationException , UnsupportedWorkspaceConfigurationException , UpdateConnectionAliasPermissionRequest , UpdateConnectionAliasPermissionResult , UpdateResult , UpdateRulesOfIpGroupRequest , UpdateRulesOfIpGroupResult , UpdateWorkspaceBundleRequest , UpdateWorkspaceBundleResult , UpdateWorkspaceImagePermissionRequest , UpdateWorkspaceImagePermissionResult , UserStorage , Workspace , WorkspaceAccessProperties , WorkspaceBundle , WorkspaceConnectionStatus , WorkspaceCreationProperties , WorkspaceDirectory , WorkspaceImage , WorkspaceProperties , WorkspaceRequest , WorkspacesDefaultRoleNotFoundException , WorkspacesIpGroup , } from "../models/models_0" ; export const serializeAws_json1_1AssociateConnectionAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.AssociateConnectionAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AssociateConnectionAliasRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AssociateIpGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.AssociateIpGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AssociateIpGroupsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1AuthorizeIpRulesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.AuthorizeIpRules" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1AuthorizeIpRulesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CopyWorkspaceImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CopyWorkspaceImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CopyWorkspaceImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateConnectionAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateConnectionAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateConnectionAliasRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateIpGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateIpGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateIpGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateUpdatedWorkspaceImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateUpdatedWorkspaceImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateUpdatedWorkspaceImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateWorkspaceBundleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateWorkspaceBundle" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateWorkspaceBundleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1CreateWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.CreateWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1CreateWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteConnectionAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeleteConnectionAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteConnectionAliasRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteIpGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeleteIpGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteIpGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeleteTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteWorkspaceBundleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeleteWorkspaceBundle" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteWorkspaceBundleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeleteWorkspaceImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeleteWorkspaceImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeleteWorkspaceImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DeregisterWorkspaceDirectoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DeregisterWorkspaceDirectory" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DeregisterWorkspaceDirectoryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeAccountModificationsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeAccountModifications" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeAccountModificationsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeClientPropertiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeClientProperties" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeClientPropertiesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeConnectionAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeConnectionAliases" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeConnectionAliasesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeConnectionAliasPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeConnectionAliasPermissions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeConnectionAliasPermissionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeIpGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeIpGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeIpGroupsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeTagsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeTags" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeTagsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspaceBundlesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaceBundles" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspaceBundlesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspaceDirectoriesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaceDirectories" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspaceDirectoriesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspaceImagePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaceImagePermissions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspaceImagePermissionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspaceImagesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaceImages" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspaceImagesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspacesConnectionStatusCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspacesConnectionStatus" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspacesConnectionStatusRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DescribeWorkspaceSnapshotsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DescribeWorkspaceSnapshots" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DescribeWorkspaceSnapshotsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DisassociateConnectionAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DisassociateConnectionAlias" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DisassociateConnectionAliasRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1DisassociateIpGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.DisassociateIpGroups" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1DisassociateIpGroupsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ImportWorkspaceImageCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ImportWorkspaceImage" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ImportWorkspaceImageRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ListAvailableManagementCidrRangesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ListAvailableManagementCidrRanges" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ListAvailableManagementCidrRangesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1MigrateWorkspaceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.MigrateWorkspace" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1MigrateWorkspaceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyAccountCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyAccount" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyAccountRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyClientPropertiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyClientProperties" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyClientPropertiesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifySelfservicePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifySelfservicePermissions" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifySelfservicePermissionsRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyWorkspaceAccessPropertiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyWorkspaceAccessProperties" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyWorkspaceAccessPropertiesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyWorkspaceCreationPropertiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyWorkspaceCreationProperties" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyWorkspaceCreationPropertiesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyWorkspacePropertiesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyWorkspaceProperties" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyWorkspacePropertiesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1ModifyWorkspaceStateCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.ModifyWorkspaceState" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1ModifyWorkspaceStateRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RebootWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.RebootWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RebootWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RebuildWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.RebuildWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RebuildWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RegisterWorkspaceDirectoryCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.RegisterWorkspaceDirectory" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RegisterWorkspaceDirectoryRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RestoreWorkspaceCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.RestoreWorkspace" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RestoreWorkspaceRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1RevokeIpRulesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.RevokeIpRules" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1RevokeIpRulesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StartWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.StartWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StartWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1StopWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.StopWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1StopWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1TerminateWorkspacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.TerminateWorkspaces" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1TerminateWorkspacesRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateConnectionAliasPermissionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.UpdateConnectionAliasPermission" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateConnectionAliasPermissionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateRulesOfIpGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.UpdateRulesOfIpGroup" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateRulesOfIpGroupRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateWorkspaceBundleCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.UpdateWorkspaceBundle" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateWorkspaceBundleRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const serializeAws_json1_1UpdateWorkspaceImagePermissionCommand = async ( input , context ) : Promise < __HttpRequest > => { const headers = { "content-type" : "application/x-amz-json-1.1" , "x-amz-target" : "WorkspacesService.UpdateWorkspaceImagePermission" , } ; let body ; body = JSON . stringify ( serializeAws_json1_1UpdateWorkspaceImagePermissionRequest ( input , context ) ) ; return buildHttpRpcRequest ( context , headers , "/" , undefined , body ) ; } ; export const deserializeAws_json1_1AssociateConnectionAliasCommand = async ( output , context ) : Promise < AssociateConnectionAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AssociateConnectionAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AssociateConnectionAliasResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AssociateConnectionAliasCommandError = async ( output , context ) : Promise < AssociateConnectionAliasCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1AssociateIpGroupsCommand = async ( output , context ) : Promise < AssociateIpGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AssociateIpGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AssociateIpGroupsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AssociateIpGroupsCommandError = async ( output , context ) : Promise < AssociateIpGroupsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1AuthorizeIpRulesCommand = async ( output , context ) : Promise < AuthorizeIpRulesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1AuthorizeIpRulesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1AuthorizeIpRulesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1AuthorizeIpRulesCommandError = async ( output , context ) : Promise < AuthorizeIpRulesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CopyWorkspaceImageCommand = async ( output , context ) : Promise < CopyWorkspaceImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CopyWorkspaceImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CopyWorkspaceImageResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CopyWorkspaceImageCommandError = async ( output , context ) : Promise < CopyWorkspaceImageCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1CreateConnectionAliasCommand = async ( output , context ) : Promise < CreateConnectionAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateConnectionAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateConnectionAliasResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateConnectionAliasCommandError = async ( output , context ) : Promise < CreateConnectionAliasCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( 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_1CreateIpGroupCommand = async ( output , context ) : Promise < CreateIpGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateIpGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateIpGroupResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateIpGroupCommandError = async ( output , context ) : Promise < CreateIpGroupCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceCreationFailedException" : case "com.amazonaws.workspaces#ResourceCreationFailedException" : response = { ... ( await deserializeAws_json1_1ResourceCreationFailedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateTagsCommand = async ( output , context ) : Promise < CreateTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateTagsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateTagsCommandError = async ( output , context ) : Promise < CreateTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateUpdatedWorkspaceImageCommand = async ( output , context ) : Promise < CreateUpdatedWorkspaceImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateUpdatedWorkspaceImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateUpdatedWorkspaceImageResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateUpdatedWorkspaceImageCommandError = async ( output , context ) : Promise < CreateUpdatedWorkspaceImageCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1CreateWorkspaceBundleCommand = async ( output , context ) : Promise < CreateWorkspaceBundleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateWorkspaceBundleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateWorkspaceBundleResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateWorkspaceBundleCommandError = async ( output , context ) : Promise < CreateWorkspaceBundleCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1CreateWorkspacesCommand = async ( output , context ) : Promise < CreateWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1CreateWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1CreateWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1CreateWorkspacesCommandError = async ( output , context ) : Promise < CreateWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( 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_1DeleteConnectionAliasCommand = async ( output , context ) : Promise < DeleteConnectionAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteConnectionAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteConnectionAliasResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteConnectionAliasCommandError = async ( output , context ) : Promise < DeleteConnectionAliasCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteIpGroupCommand = async ( output , context ) : Promise < DeleteIpGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteIpGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteIpGroupResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteIpGroupCommandError = async ( output , context ) : Promise < DeleteIpGroupCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteTagsCommand = async ( output , context ) : Promise < DeleteTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteTagsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteTagsCommandError = async ( output , context ) : Promise < DeleteTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteWorkspaceBundleCommand = async ( output , context ) : Promise < DeleteWorkspaceBundleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteWorkspaceBundleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteWorkspaceBundleResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteWorkspaceBundleCommandError = async ( output , context ) : Promise < DeleteWorkspaceBundleCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DeleteWorkspaceImageCommand = async ( output , context ) : Promise < DeleteWorkspaceImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeleteWorkspaceImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeleteWorkspaceImageResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeleteWorkspaceImageCommandError = async ( output , context ) : Promise < DeleteWorkspaceImageCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( 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_1DeregisterWorkspaceDirectoryCommand = async ( output , context ) : Promise < DeregisterWorkspaceDirectoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DeregisterWorkspaceDirectoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DeregisterWorkspaceDirectoryResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DeregisterWorkspaceDirectoryCommandError = async ( output , context ) : Promise < DeregisterWorkspaceDirectoryCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeAccountCommand = async ( output , context ) : Promise < DescribeAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAccountResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAccountCommandError = async ( output , context ) : Promise < DescribeAccountCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( 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_1DescribeAccountModificationsCommand = async ( output , context ) : Promise < DescribeAccountModificationsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeAccountModificationsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeAccountModificationsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeAccountModificationsCommandError = async ( output , context ) : Promise < DescribeAccountModificationsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( 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_1DescribeClientPropertiesCommand = async ( output , context ) : Promise < DescribeClientPropertiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeClientPropertiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeClientPropertiesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeClientPropertiesCommandError = async ( output , context ) : Promise < DescribeClientPropertiesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeConnectionAliasesCommand = async ( output , context ) : Promise < DescribeConnectionAliasesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeConnectionAliasesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeConnectionAliasesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeConnectionAliasesCommandError = async ( output , context ) : Promise < DescribeConnectionAliasesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( 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_1DescribeConnectionAliasPermissionsCommand = async ( output , context ) : Promise < DescribeConnectionAliasPermissionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeConnectionAliasPermissionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeConnectionAliasPermissionsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeConnectionAliasPermissionsCommandError = async ( output , context ) : Promise < DescribeConnectionAliasPermissionsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeIpGroupsCommand = async ( output , context ) : Promise < DescribeIpGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeIpGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeIpGroupsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeIpGroupsCommandError = async ( output , context ) : Promise < DescribeIpGroupsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeTagsCommand = async ( output , context ) : Promise < DescribeTagsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeTagsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeTagsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeTagsCommandError = async ( output , context ) : Promise < DescribeTagsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeWorkspaceBundlesCommand = async ( output , context ) : Promise < DescribeWorkspaceBundlesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspaceBundlesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspaceBundlesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspaceBundlesCommandError = async ( output , context ) : Promise < DescribeWorkspaceBundlesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( 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_1DescribeWorkspaceDirectoriesCommand = async ( output , context ) : Promise < DescribeWorkspaceDirectoriesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspaceDirectoriesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspaceDirectoriesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspaceDirectoriesCommandError = async ( output , context ) : Promise < DescribeWorkspaceDirectoriesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( 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_1DescribeWorkspaceImagePermissionsCommand = async ( output , context ) : Promise < DescribeWorkspaceImagePermissionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspaceImagePermissionsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspaceImagePermissionsCommandError = async ( output , context ) : Promise < DescribeWorkspaceImagePermissionsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DescribeWorkspaceImagesCommand = async ( output , context ) : Promise < DescribeWorkspaceImagesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspaceImagesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspaceImagesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspaceImagesCommandError = async ( output , context ) : Promise < DescribeWorkspaceImagesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( 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_1DescribeWorkspacesCommand = async ( output , context ) : Promise < DescribeWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspacesCommandError = async ( output , context ) : Promise < DescribeWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1DescribeWorkspacesConnectionStatusCommand = async ( output , context ) : Promise < DescribeWorkspacesConnectionStatusCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspacesConnectionStatusResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspacesConnectionStatusCommandError = async ( output , context ) : Promise < DescribeWorkspacesConnectionStatusCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( 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_1DescribeWorkspaceSnapshotsCommand = async ( output , context ) : Promise < DescribeWorkspaceSnapshotsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DescribeWorkspaceSnapshotsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DescribeWorkspaceSnapshotsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DescribeWorkspaceSnapshotsCommandError = async ( output , context ) : Promise < DescribeWorkspaceSnapshotsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DisassociateConnectionAliasCommand = async ( output , context ) : Promise < DisassociateConnectionAliasCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DisassociateConnectionAliasCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DisassociateConnectionAliasResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DisassociateConnectionAliasCommandError = async ( output , context ) : Promise < DisassociateConnectionAliasCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1DisassociateIpGroupsCommand = async ( output , context ) : Promise < DisassociateIpGroupsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1DisassociateIpGroupsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1DisassociateIpGroupsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1DisassociateIpGroupsCommandError = async ( output , context ) : Promise < DisassociateIpGroupsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ImportWorkspaceImageCommand = async ( output , context ) : Promise < ImportWorkspaceImageCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ImportWorkspaceImageCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ImportWorkspaceImageResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ImportWorkspaceImageCommandError = async ( output , context ) : Promise < ImportWorkspaceImageCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAlreadyExistsException" : case "com.amazonaws.workspaces#ResourceAlreadyExistsException" : response = { ... ( await deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ListAvailableManagementCidrRangesCommand = async ( output , context ) : Promise < ListAvailableManagementCidrRangesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ListAvailableManagementCidrRangesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ListAvailableManagementCidrRangesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ListAvailableManagementCidrRangesCommandError = async ( output , context ) : Promise < ListAvailableManagementCidrRangesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( 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_1MigrateWorkspaceCommand = async ( output , context ) : Promise < MigrateWorkspaceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1MigrateWorkspaceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1MigrateWorkspaceResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1MigrateWorkspaceCommandError = async ( output , context ) : Promise < MigrateWorkspaceCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationInProgressException" : case "com.amazonaws.workspaces#OperationInProgressException" : response = { ... ( await deserializeAws_json1_1OperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1ModifyAccountCommand = async ( output , context ) : Promise < ModifyAccountCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyAccountCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyAccountResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyAccountCommandError = async ( output , context ) : Promise < ModifyAccountCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1ModifyClientPropertiesCommand = async ( output , context ) : Promise < ModifyClientPropertiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyClientPropertiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyClientPropertiesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyClientPropertiesCommandError = async ( output , context ) : Promise < ModifyClientPropertiesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ModifySelfservicePermissionsCommand = async ( output , context ) : Promise < ModifySelfservicePermissionsCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifySelfservicePermissionsCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifySelfservicePermissionsResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifySelfservicePermissionsCommandError = async ( output , context ) : Promise < ModifySelfservicePermissionsCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommand = async ( output , context ) : Promise < ModifyWorkspaceAccessPropertiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyWorkspaceAccessPropertiesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyWorkspaceAccessPropertiesCommandError = async ( output , context ) : Promise < ModifyWorkspaceAccessPropertiesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommand = async ( output , context ) : Promise < ModifyWorkspaceCreationPropertiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyWorkspaceCreationPropertiesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyWorkspaceCreationPropertiesCommandError = async ( output , context ) : Promise < ModifyWorkspaceCreationPropertiesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1ModifyWorkspacePropertiesCommand = async ( output , context ) : Promise < ModifyWorkspacePropertiesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyWorkspacePropertiesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyWorkspacePropertiesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyWorkspacePropertiesCommandError = async ( output , context ) : Promise < ModifyWorkspacePropertiesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationInProgressException" : case "com.amazonaws.workspaces#OperationInProgressException" : response = { ... ( await deserializeAws_json1_1OperationInProgressExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedWorkspaceConfigurationException" : case "com.amazonaws.workspaces#UnsupportedWorkspaceConfigurationException" : response = { ... ( await deserializeAws_json1_1UnsupportedWorkspaceConfigurationExceptionResponse ( 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_1ModifyWorkspaceStateCommand = async ( output , context ) : Promise < ModifyWorkspaceStateCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1ModifyWorkspaceStateCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1ModifyWorkspaceStateResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1ModifyWorkspaceStateCommandError = async ( output , context ) : Promise < ModifyWorkspaceStateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1RebootWorkspacesCommand = async ( output , context ) : Promise < RebootWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RebootWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RebootWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RebootWorkspacesCommandError = async ( output , context ) : Promise < RebootWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { 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_1RebuildWorkspacesCommand = async ( output , context ) : Promise < RebuildWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RebuildWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RebuildWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RebuildWorkspacesCommandError = async ( output , context ) : Promise < RebuildWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { 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_1RegisterWorkspaceDirectoryCommand = async ( output , context ) : Promise < RegisterWorkspaceDirectoryCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RegisterWorkspaceDirectoryCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RegisterWorkspaceDirectoryResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RegisterWorkspaceDirectoryCommandError = async ( output , context ) : Promise < RegisterWorkspaceDirectoryCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedNetworkConfigurationException" : case "com.amazonaws.workspaces#UnsupportedNetworkConfigurationException" : response = { ... ( await deserializeAws_json1_1UnsupportedNetworkConfigurationExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "WorkspacesDefaultRoleNotFoundException" : case "com.amazonaws.workspaces#WorkspacesDefaultRoleNotFoundException" : response = { ... ( await deserializeAws_json1_1WorkspacesDefaultRoleNotFoundExceptionResponse ( 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_1RestoreWorkspaceCommand = async ( output , context ) : Promise < RestoreWorkspaceCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RestoreWorkspaceCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RestoreWorkspaceResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RestoreWorkspaceCommandError = async ( output , context ) : Promise < RestoreWorkspaceCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1RevokeIpRulesCommand = async ( output , context ) : Promise < RevokeIpRulesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1RevokeIpRulesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1RevokeIpRulesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1RevokeIpRulesCommandError = async ( output , context ) : Promise < RevokeIpRulesCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1StartWorkspacesCommand = async ( output , context ) : Promise < StartWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StartWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StartWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StartWorkspacesCommandError = async ( output , context ) : Promise < StartWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { 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_1StopWorkspacesCommand = async ( output , context ) : Promise < StopWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1StopWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1StopWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1StopWorkspacesCommandError = async ( output , context ) : Promise < StopWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { 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_1TerminateWorkspacesCommand = async ( output , context ) : Promise < TerminateWorkspacesCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1TerminateWorkspacesCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1TerminateWorkspacesResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1TerminateWorkspacesCommandError = async ( output , context ) : Promise < TerminateWorkspacesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { 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_1UpdateConnectionAliasPermissionCommand = async ( output , context ) : Promise < UpdateConnectionAliasPermissionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateConnectionAliasPermissionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateConnectionAliasPermissionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateConnectionAliasPermissionCommandError = async ( output , context ) : Promise < UpdateConnectionAliasPermissionCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceAssociatedException" : case "com.amazonaws.workspaces#ResourceAssociatedException" : response = { ... ( await deserializeAws_json1_1ResourceAssociatedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateRulesOfIpGroupCommand = async ( output , context ) : Promise < UpdateRulesOfIpGroupCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateRulesOfIpGroupCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateRulesOfIpGroupResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateRulesOfIpGroupCommandError = async ( output , context ) : Promise < UpdateRulesOfIpGroupCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidResourceStateException" : case "com.amazonaws.workspaces#InvalidResourceStateException" : response = { ... ( await deserializeAws_json1_1InvalidResourceStateExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceLimitExceededException" : case "com.amazonaws.workspaces#ResourceLimitExceededException" : response = { ... ( await deserializeAws_json1_1ResourceLimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; export const deserializeAws_json1_1UpdateWorkspaceBundleCommand = async ( output , context ) : Promise < UpdateWorkspaceBundleCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateWorkspaceBundleCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateWorkspaceBundleResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateWorkspaceBundleCommandError = async ( output , context ) : Promise < UpdateWorkspaceBundleCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( 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_1UpdateWorkspaceImagePermissionCommand = async ( output , context ) : Promise < UpdateWorkspaceImagePermissionCommandOutput > => { if ( output . statusCode >= 300 ) { return deserializeAws_json1_1UpdateWorkspaceImagePermissionCommandError ( output , context ) ; } const data = await parseBody ( output . body , context ) ; let contents = { } ; contents = deserializeAws_json1_1UpdateWorkspaceImagePermissionResult ( data , context ) ; const response = { $metadata : deserializeMetadata ( output ) , ... contents , } ; return Promise . resolve ( response ) ; } ; const deserializeAws_json1_1UpdateWorkspaceImagePermissionCommandError = async ( output , context ) : Promise < UpdateWorkspaceImagePermissionCommandOutput > => { 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.workspaces#AccessDeniedException" : response = { ... ( await deserializeAws_json1_1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValuesException" : case "com.amazonaws.workspaces#InvalidParameterValuesException" : response = { ... ( await deserializeAws_json1_1InvalidParameterValuesExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "OperationNotSupportedException" : case "com.amazonaws.workspaces#OperationNotSupportedException" : response = { ... ( await deserializeAws_json1_1OperationNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.workspaces#ResourceNotFoundException" : response = { ... ( await deserializeAws_json1_1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.workspaces#ResourceUnavailableException" : response = { ... ( await deserializeAws_json1_1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; default : const parsedBody = parsedOutput . body ; errorCode = parsedBody . code || parsedBody . Code || errorCode ; response = { ... parsedBody , name : `${ errorCode }` , message : parsedBody . message || parsedBody . Message || errorCode , $fault : "client" , $metadata : deserializeMetadata ( output ) , } as any ; } const message = response . message || response . Message || errorCode ; response . message = message ; delete response . Message ; return Promise . reject ( Object . assign ( new Error ( message ) , response ) ) ; } ; const deserializeAws_json1_1AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1AccessDeniedException ( body , context ) ; const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidParameterValuesExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterValuesException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidParameterValuesException ( body , context ) ; const contents = { name : "InvalidParameterValuesException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1InvalidResourceStateExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidResourceStateException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1InvalidResourceStateException ( body , context ) ; const contents = { name : "InvalidResourceStateException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1OperationInProgressExceptionResponse = async ( parsedOutput , context ) : Promise < OperationInProgressException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1OperationInProgressException ( body , context ) ; const contents = { name : "OperationInProgressException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1OperationNotSupportedExceptionResponse = async ( parsedOutput , context ) : Promise < OperationNotSupportedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1OperationNotSupportedException ( body , context ) ; const contents = { name : "OperationNotSupportedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceAlreadyExistsExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceAlreadyExistsException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceAlreadyExistsException ( body , context ) ; const contents = { name : "ResourceAlreadyExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceAssociatedExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceAssociatedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceAssociatedException ( body , context ) ; const contents = { name : "ResourceAssociatedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceCreationFailedExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceCreationFailedException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceCreationFailedException ( body , context ) ; const contents = { name : "ResourceCreationFailedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceLimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceLimitExceededException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceLimitExceededException ( body , context ) ; const contents = { name : "ResourceLimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceNotFoundException ( body , context ) ; const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1ResourceUnavailableExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceUnavailableException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1ResourceUnavailableException ( body , context ) ; const contents = { name : "ResourceUnavailableException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedNetworkConfigurationExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedNetworkConfigurationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedNetworkConfigurationException ( body , context ) ; const contents = { name : "UnsupportedNetworkConfigurationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1UnsupportedWorkspaceConfigurationExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedWorkspaceConfigurationException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1UnsupportedWorkspaceConfigurationException ( body , context ) ; const contents = { name : "UnsupportedWorkspaceConfigurationException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const deserializeAws_json1_1WorkspacesDefaultRoleNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < WorkspacesDefaultRoleNotFoundException > => { const body = parsedOutput . body ; const deserialized = deserializeAws_json1_1WorkspacesDefaultRoleNotFoundException ( body , context ) ; const contents = { name : "WorkspacesDefaultRoleNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , ... deserialized , } ; return contents ; } ; const serializeAws_json1_1ApplicationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1AssociateConnectionAliasRequest = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , } ; } ; const serializeAws_json1_1AssociateIpGroupsRequest = ( input , context ) : any => { return { ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , ... ( input . GroupIds !== undefined && input . GroupIds !== null && { GroupIds : serializeAws_json1_1IpGroupIdList ( input . GroupIds , context ) } ) , } ; } ; const serializeAws_json1_1AuthorizeIpRulesRequest = ( input , context ) : any => { return { ... ( input . GroupId !== undefined && input . GroupId !== null && { GroupId : input . GroupId } ) , ... ( input . UserRules !== undefined && input . UserRules !== null && { UserRules : serializeAws_json1_1IpRuleList ( input . UserRules , context ) } ) , } ; } ; const serializeAws_json1_1BundleIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ClientProperties = ( input , context ) : any => { return { ... ( input . ReconnectEnabled !== undefined && input . ReconnectEnabled !== null && { ReconnectEnabled : input . ReconnectEnabled } ) , } ; } ; const serializeAws_json1_1ComputeType = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_json1_1ConnectionAliasIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1ConnectionAliasPermission = ( input , context ) : any => { return { ... ( input . AllowAssociation !== undefined && input . AllowAssociation !== null && { AllowAssociation : input . AllowAssociation } ) , ... ( input . SharedAccountId !== undefined && input . SharedAccountId !== null && { SharedAccountId : input . SharedAccountId } ) , } ; } ; const serializeAws_json1_1CopyWorkspaceImageRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SourceImageId !== undefined && input . SourceImageId !== null && { SourceImageId : input . SourceImageId } ) , ... ( input . SourceRegion !== undefined && input . SourceRegion !== null && { SourceRegion : input . SourceRegion } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateConnectionAliasRequest = ( input , context ) : any => { return { ... ( input . ConnectionString !== undefined && input . ConnectionString !== null && { ConnectionString : input . ConnectionString } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateIpGroupRequest = ( input , context ) : any => { return { ... ( input . GroupDesc !== undefined && input . GroupDesc !== null && { GroupDesc : input . GroupDesc } ) , ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . UserRules !== undefined && input . UserRules !== null && { UserRules : serializeAws_json1_1IpRuleList ( input . UserRules , context ) } ) , } ; } ; const serializeAws_json1_1CreateTagsRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateUpdatedWorkspaceImageRequest = ( input , context ) : any => { return { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SourceImageId !== undefined && input . SourceImageId !== null && { SourceImageId : input . SourceImageId } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1CreateWorkspaceBundleRequest = ( input , context ) : any => { return { ... ( input . BundleDescription !== undefined && input . BundleDescription !== null && { BundleDescription : input . BundleDescription } ) , ... ( input . BundleName !== undefined && input . BundleName !== null && { BundleName : input . BundleName } ) , ... ( input . ComputeType !== undefined && input . ComputeType !== null && { ComputeType : serializeAws_json1_1ComputeType ( input . ComputeType , context ) } ) , ... ( input . ImageId !== undefined && input . ImageId !== null && { ImageId : input . ImageId } ) , ... ( input . RootStorage !== undefined && input . RootStorage !== null && { RootStorage : serializeAws_json1_1RootStorage ( input . RootStorage , context ) } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . UserStorage !== undefined && input . UserStorage !== null && { UserStorage : serializeAws_json1_1UserStorage ( input . UserStorage , context ) } ) , } ; } ; const serializeAws_json1_1CreateWorkspacesRequest = ( input , context ) : any => { return { ... ( input . Workspaces !== undefined && input . Workspaces !== null && { Workspaces : serializeAws_json1_1WorkspaceRequestList ( input . Workspaces , context ) } ) , } ; } ; const serializeAws_json1_1DeleteConnectionAliasRequest = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , } ; } ; const serializeAws_json1_1DeleteIpGroupRequest = ( input , context ) : any => { return { ... ( input . GroupId !== undefined && input . GroupId !== null && { GroupId : input . GroupId } ) , } ; } ; const serializeAws_json1_1DeleteTagsRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , ... ( input . TagKeys !== undefined && input . TagKeys !== null && { TagKeys : serializeAws_json1_1TagKeyList ( input . TagKeys , context ) } ) , } ; } ; const serializeAws_json1_1DeleteWorkspaceBundleRequest = ( input , context ) : any => { return { ... ( input . BundleId !== undefined && input . BundleId !== null && { BundleId : input . BundleId } ) , } ; } ; const serializeAws_json1_1DeleteWorkspaceImageRequest = ( input , context ) : any => { return { ... ( input . ImageId !== undefined && input . ImageId !== null && { ImageId : input . ImageId } ) , } ; } ; const serializeAws_json1_1DeregisterWorkspaceDirectoryRequest = ( input , context ) : any => { return { ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , } ; } ; const serializeAws_json1_1DescribeAccountModificationsRequest = ( input , context ) : any => { return { ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeAccountRequest = ( input , context ) : any => { return { } ; } ; const serializeAws_json1_1DescribeClientPropertiesRequest = ( input , context ) : any => { return { ... ( input . ResourceIds !== undefined && input . ResourceIds !== null && { ResourceIds : serializeAws_json1_1ResourceIdList ( input . ResourceIds , context ) } ) , } ; } ; const serializeAws_json1_1DescribeConnectionAliasesRequest = ( input , context ) : any => { return { ... ( input . AliasIds !== undefined && input . AliasIds !== null && { AliasIds : serializeAws_json1_1ConnectionAliasIdList ( input . AliasIds , context ) } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , } ; } ; const serializeAws_json1_1DescribeConnectionAliasPermissionsRequest = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeIpGroupsRequest = ( input , context ) : any => { return { ... ( input . GroupIds !== undefined && input . GroupIds !== null && { GroupIds : serializeAws_json1_1IpGroupIdList ( input . GroupIds , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeTagsRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , } ; } ; const serializeAws_json1_1DescribeWorkspaceBundlesRequest = ( input , context ) : any => { return { ... ( input . BundleIds !== undefined && input . BundleIds !== null && { BundleIds : serializeAws_json1_1BundleIdList ( input . BundleIds , context ) } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . Owner !== undefined && input . Owner !== null && { Owner : input . Owner } ) , } ; } ; const serializeAws_json1_1DescribeWorkspaceDirectoriesRequest = ( input , context ) : any => { return { ... ( input . DirectoryIds !== undefined && input . DirectoryIds !== null && { DirectoryIds : serializeAws_json1_1DirectoryIdList ( input . DirectoryIds , context ) , } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeWorkspaceImagePermissionsRequest = ( input , context ) : any => { return { ... ( input . ImageId !== undefined && input . ImageId !== null && { ImageId : input . ImageId } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeWorkspaceImagesRequest = ( input , context ) : any => { return { ... ( input . ImageIds !== undefined && input . ImageIds !== null && { ImageIds : serializeAws_json1_1WorkspaceImageIdList ( input . ImageIds , context ) } ) , ... ( input . ImageType !== undefined && input . ImageType !== null && { ImageType : input . ImageType } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1DescribeWorkspacesConnectionStatusRequest = ( input , context ) : any => { return { ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . WorkspaceIds !== undefined && input . WorkspaceIds !== null && { WorkspaceIds : serializeAws_json1_1WorkspaceIdList ( input . WorkspaceIds , context ) , } ) , } ; } ; const serializeAws_json1_1DescribeWorkspaceSnapshotsRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1DescribeWorkspacesRequest = ( input , context ) : any => { return { ... ( input . BundleId !== undefined && input . BundleId !== null && { BundleId : input . BundleId } ) , ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , ... ( input . Limit !== undefined && input . Limit !== null && { Limit : input . Limit } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , ... ( input . UserName !== undefined && input . UserName !== null && { UserName : input . UserName } ) , ... ( input . WorkspaceIds !== undefined && input . WorkspaceIds !== null && { WorkspaceIds : serializeAws_json1_1WorkspaceIdList ( input . WorkspaceIds , context ) , } ) , } ; } ; const serializeAws_json1_1DirectoryIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1DisassociateConnectionAliasRequest = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , } ; } ; const serializeAws_json1_1DisassociateIpGroupsRequest = ( input , context ) : any => { return { ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , ... ( input . GroupIds !== undefined && input . GroupIds !== null && { GroupIds : serializeAws_json1_1IpGroupIdList ( input . GroupIds , context ) } ) , } ; } ; const serializeAws_json1_1ImportWorkspaceImageRequest = ( input , context ) : any => { return { ... ( input . Applications !== undefined && input . Applications !== null && { Applications : serializeAws_json1_1ApplicationList ( input . Applications , context ) , } ) , ... ( input . Ec2ImageId !== undefined && input . Ec2ImageId !== null && { Ec2ImageId : input . Ec2ImageId } ) , ... ( input . ImageDescription !== undefined && input . ImageDescription !== null && { ImageDescription : input . ImageDescription } ) , ... ( input . ImageName !== undefined && input . ImageName !== null && { ImageName : input . ImageName } ) , ... ( input . IngestionProcess !== undefined && input . IngestionProcess !== null && { IngestionProcess : input . IngestionProcess } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_json1_1IpGroupIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1IpRevokedRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1IpRuleItem = ( input , context ) : any => { return { ... ( input . ipRule !== undefined && input . ipRule !== null && { ipRule : input . ipRule } ) , ... ( input . ruleDesc !== undefined && input . ruleDesc !== null && { ruleDesc : input . ruleDesc } ) , } ; } ; const serializeAws_json1_1IpRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1IpRuleItem ( entry , context ) ; } ) ; } ; const serializeAws_json1_1ListAvailableManagementCidrRangesRequest = ( input , context ) : any => { return { ... ( input . ManagementCidrRangeConstraint !== undefined && input . ManagementCidrRangeConstraint !== null && { ManagementCidrRangeConstraint : input . ManagementCidrRangeConstraint , } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ; } ; const serializeAws_json1_1MigrateWorkspaceRequest = ( input , context ) : any => { return { ... ( input . BundleId !== undefined && input . BundleId !== null && { BundleId : input . BundleId } ) , ... ( input . SourceWorkspaceId !== undefined && input . SourceWorkspaceId !== null && { SourceWorkspaceId : input . SourceWorkspaceId } ) , } ; } ; const serializeAws_json1_1ModifyAccountRequest = ( input , context ) : any => { return { ... ( input . DedicatedTenancyManagementCidrRange !== undefined && input . DedicatedTenancyManagementCidrRange !== null && { DedicatedTenancyManagementCidrRange : input . DedicatedTenancyManagementCidrRange , } ) , ... ( input . DedicatedTenancySupport !== undefined && input . DedicatedTenancySupport !== null && { DedicatedTenancySupport : input . DedicatedTenancySupport } ) , } ; } ; const serializeAws_json1_1ModifyClientPropertiesRequest = ( input , context ) : any => { return { ... ( input . ClientProperties !== undefined && input . ClientProperties !== null && { ClientProperties : serializeAws_json1_1ClientProperties ( input . ClientProperties , context ) , } ) , ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , } ; } ; const serializeAws_json1_1ModifySelfservicePermissionsRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , ... ( input . SelfservicePermissions !== undefined && input . SelfservicePermissions !== null && { SelfservicePermissions : serializeAws_json1_1SelfservicePermissions ( input . SelfservicePermissions , context ) , } ) , } ; } ; const serializeAws_json1_1ModifyWorkspaceAccessPropertiesRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , ... ( input . WorkspaceAccessProperties !== undefined && input . WorkspaceAccessProperties !== null && { WorkspaceAccessProperties : serializeAws_json1_1WorkspaceAccessProperties ( input . WorkspaceAccessProperties , context ) , } ) , } ; } ; const serializeAws_json1_1ModifyWorkspaceCreationPropertiesRequest = ( input , context ) : any => { return { ... ( input . ResourceId !== undefined && input . ResourceId !== null && { ResourceId : input . ResourceId } ) , ... ( input . WorkspaceCreationProperties !== undefined && input . WorkspaceCreationProperties !== null && { WorkspaceCreationProperties : serializeAws_json1_1WorkspaceCreationProperties ( input . WorkspaceCreationProperties , context ) , } ) , } ; } ; const serializeAws_json1_1ModifyWorkspacePropertiesRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , ... ( input . WorkspaceProperties !== undefined && input . WorkspaceProperties !== null && { WorkspaceProperties : serializeAws_json1_1WorkspaceProperties ( input . WorkspaceProperties , context ) , } ) , } ; } ; const serializeAws_json1_1ModifyWorkspaceStateRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , ... ( input . WorkspaceState !== undefined && input . WorkspaceState !== null && { WorkspaceState : input . WorkspaceState } ) , } ; } ; const serializeAws_json1_1RebootRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1RebootWorkspaceRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1RebootRequest ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RebootWorkspacesRequest = ( input , context ) : any => { return { ... ( input . RebootWorkspaceRequests !== undefined && input . RebootWorkspaceRequests !== null && { RebootWorkspaceRequests : serializeAws_json1_1RebootWorkspaceRequests ( input . RebootWorkspaceRequests , context ) , } ) , } ; } ; const serializeAws_json1_1RebuildRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1RebuildWorkspaceRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1RebuildRequest ( entry , context ) ; } ) ; } ; const serializeAws_json1_1RebuildWorkspacesRequest = ( input , context ) : any => { return { ... ( input . RebuildWorkspaceRequests !== undefined && input . RebuildWorkspaceRequests !== null && { RebuildWorkspaceRequests : serializeAws_json1_1RebuildWorkspaceRequests ( input . RebuildWorkspaceRequests , context ) , } ) , } ; } ; const serializeAws_json1_1RegisterWorkspaceDirectoryRequest = ( input , context ) : any => { return { ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , ... ( input . EnableSelfService !== undefined && input . EnableSelfService !== null && { EnableSelfService : input . EnableSelfService } ) , ... ( input . EnableWorkDocs !== undefined && input . EnableWorkDocs !== null && { EnableWorkDocs : input . EnableWorkDocs } ) , ... ( input . SubnetIds !== undefined && input . SubnetIds !== null && { SubnetIds : serializeAws_json1_1SubnetIds ( input . SubnetIds , context ) } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . Tenancy !== undefined && input . Tenancy !== null && { Tenancy : input . Tenancy } ) , } ; } ; const serializeAws_json1_1ResourceIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1RestoreWorkspaceRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1RevokeIpRulesRequest = ( input , context ) : any => { return { ... ( input . GroupId !== undefined && input . GroupId !== null && { GroupId : input . GroupId } ) , ... ( input . UserRules !== undefined && input . UserRules !== null && { UserRules : serializeAws_json1_1IpRevokedRuleList ( input . UserRules , context ) } ) , } ; } ; const serializeAws_json1_1RootStorage = ( input , context ) : any => { return { ... ( input . Capacity !== undefined && input . Capacity !== null && { Capacity : input . Capacity } ) , } ; } ; const serializeAws_json1_1SelfservicePermissions = ( input , context ) : any => { return { ... ( input . ChangeComputeType !== undefined && input . ChangeComputeType !== null && { ChangeComputeType : input . ChangeComputeType } ) , ... ( input . IncreaseVolumeSize !== undefined && input . IncreaseVolumeSize !== null && { IncreaseVolumeSize : input . IncreaseVolumeSize } ) , ... ( input . RebuildWorkspace !== undefined && input . RebuildWorkspace !== null && { RebuildWorkspace : input . RebuildWorkspace } ) , ... ( input . RestartWorkspace !== undefined && input . RestartWorkspace !== null && { RestartWorkspace : input . RestartWorkspace } ) , ... ( input . SwitchRunningMode !== undefined && input . SwitchRunningMode !== null && { SwitchRunningMode : input . SwitchRunningMode } ) , } ; } ; const serializeAws_json1_1StartRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1StartWorkspaceRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1StartRequest ( entry , context ) ; } ) ; } ; const serializeAws_json1_1StartWorkspacesRequest = ( input , context ) : any => { return { ... ( input . StartWorkspaceRequests !== undefined && input . StartWorkspaceRequests !== null && { StartWorkspaceRequests : serializeAws_json1_1StartWorkspaceRequests ( input . StartWorkspaceRequests , context ) , } ) , } ; } ; const serializeAws_json1_1StopRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1StopWorkspaceRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1StopRequest ( entry , context ) ; } ) ; } ; const serializeAws_json1_1StopWorkspacesRequest = ( input , context ) : any => { return { ... ( input . StopWorkspaceRequests !== undefined && input . StopWorkspaceRequests !== null && { StopWorkspaceRequests : serializeAws_json1_1StopWorkspaceRequests ( input . StopWorkspaceRequests , context ) , } ) , } ; } ; const serializeAws_json1_1SubnetIds = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_json1_1TagKeyList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TerminateRequest = ( input , context ) : any => { return { ... ( input . WorkspaceId !== undefined && input . WorkspaceId !== null && { WorkspaceId : input . WorkspaceId } ) , } ; } ; const serializeAws_json1_1TerminateWorkspaceRequests = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1TerminateRequest ( entry , context ) ; } ) ; } ; const serializeAws_json1_1TerminateWorkspacesRequest = ( input , context ) : any => { return { ... ( input . TerminateWorkspaceRequests !== undefined && input . TerminateWorkspaceRequests !== null && { TerminateWorkspaceRequests : serializeAws_json1_1TerminateWorkspaceRequests ( input . TerminateWorkspaceRequests , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateConnectionAliasPermissionRequest = ( input , context ) : any => { return { ... ( input . AliasId !== undefined && input . AliasId !== null && { AliasId : input . AliasId } ) , ... ( input . ConnectionAliasPermission !== undefined && input . ConnectionAliasPermission !== null && { ConnectionAliasPermission : serializeAws_json1_1ConnectionAliasPermission ( input . ConnectionAliasPermission , context ) , } ) , } ; } ; const serializeAws_json1_1UpdateRulesOfIpGroupRequest = ( input , context ) : any => { return { ... ( input . GroupId !== undefined && input . GroupId !== null && { GroupId : input . GroupId } ) , ... ( input . UserRules !== undefined && input . UserRules !== null && { UserRules : serializeAws_json1_1IpRuleList ( input . UserRules , context ) } ) , } ; } ; const serializeAws_json1_1UpdateWorkspaceBundleRequest = ( input , context ) : any => { return { ... ( input . BundleId !== undefined && input . BundleId !== null && { BundleId : input . BundleId } ) , ... ( input . ImageId !== undefined && input . ImageId !== null && { ImageId : input . ImageId } ) , } ; } ; const serializeAws_json1_1UpdateWorkspaceImagePermissionRequest = ( input , context ) : any => { return { ... ( input . AllowCopyImage !== undefined && input . AllowCopyImage !== null && { AllowCopyImage : input . AllowCopyImage } ) , ... ( input . ImageId !== undefined && input . ImageId !== null && { ImageId : input . ImageId } ) , ... ( input . SharedAccountId !== undefined && input . SharedAccountId !== null && { SharedAccountId : input . SharedAccountId } ) , } ; } ; const serializeAws_json1_1UserStorage = ( input , context ) : any => { return { ... ( input . Capacity !== undefined && input . Capacity !== null && { Capacity : input . Capacity } ) , } ; } ; const serializeAws_json1_1WorkspaceAccessProperties = ( input , context ) : any => { return { ... ( input . DeviceTypeAndroid !== undefined && input . DeviceTypeAndroid !== null && { DeviceTypeAndroid : input . DeviceTypeAndroid } ) , ... ( input . DeviceTypeChromeOs !== undefined && input . DeviceTypeChromeOs !== null && { DeviceTypeChromeOs : input . DeviceTypeChromeOs } ) , ... ( input . DeviceTypeIos !== undefined && input . DeviceTypeIos !== null && { DeviceTypeIos : input . DeviceTypeIos } ) , ... ( input . DeviceTypeLinux !== undefined && input . DeviceTypeLinux !== null && { DeviceTypeLinux : input . DeviceTypeLinux } ) , ... ( input . DeviceTypeOsx !== undefined && input . DeviceTypeOsx !== null && { DeviceTypeOsx : input . DeviceTypeOsx } ) , ... ( input . DeviceTypeWeb !== undefined && input . DeviceTypeWeb !== null && { DeviceTypeWeb : input . DeviceTypeWeb } ) , ... ( input . DeviceTypeWindows !== undefined && input . DeviceTypeWindows !== null && { DeviceTypeWindows : input . DeviceTypeWindows } ) , ... ( input . DeviceTypeZeroClient !== undefined && input . DeviceTypeZeroClient !== null && { DeviceTypeZeroClient : input . DeviceTypeZeroClient } ) , } ; } ; const serializeAws_json1_1WorkspaceCreationProperties = ( input , context ) : any => { return { ... ( input . CustomSecurityGroupId !== undefined && input . CustomSecurityGroupId !== null && { CustomSecurityGroupId : input . CustomSecurityGroupId } ) , ... ( input . DefaultOu !== undefined && input . DefaultOu !== null && { DefaultOu : input . DefaultOu } ) , ... ( input . EnableInternetAccess !== undefined && input . EnableInternetAccess !== null && { EnableInternetAccess : input . EnableInternetAccess } ) , ... ( input . EnableMaintenanceMode !== undefined && input . EnableMaintenanceMode !== null && { EnableMaintenanceMode : input . EnableMaintenanceMode } ) , ... ( input . EnableWorkDocs !== undefined && input . EnableWorkDocs !== null && { EnableWorkDocs : input . EnableWorkDocs } ) , ... ( input . UserEnabledAsLocalAdministrator !== undefined && input . UserEnabledAsLocalAdministrator !== null && { UserEnabledAsLocalAdministrator : input . UserEnabledAsLocalAdministrator , } ) , } ; } ; const serializeAws_json1_1WorkspaceIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1WorkspaceImageIdList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_json1_1WorkspaceProperties = ( input , context ) : any => { return { ... ( input . ComputeTypeName !== undefined && input . ComputeTypeName !== null && { ComputeTypeName : input . ComputeTypeName } ) , ... ( input . RootVolumeSizeGib !== undefined && input . RootVolumeSizeGib !== null && { RootVolumeSizeGib : input . RootVolumeSizeGib } ) , ... ( input . RunningMode !== undefined && input . RunningMode !== null && { RunningMode : input . RunningMode } ) , ... ( input . RunningModeAutoStopTimeoutInMinutes !== undefined && input . RunningModeAutoStopTimeoutInMinutes !== null && { RunningModeAutoStopTimeoutInMinutes : input . RunningModeAutoStopTimeoutInMinutes , } ) , ... ( input . UserVolumeSizeGib !== undefined && input . UserVolumeSizeGib !== null && { UserVolumeSizeGib : input . UserVolumeSizeGib } ) , } ; } ; const serializeAws_json1_1WorkspaceRequest = ( input , context ) : any => { return { ... ( input . BundleId !== undefined && input . BundleId !== null && { BundleId : input . BundleId } ) , ... ( input . DirectoryId !== undefined && input . DirectoryId !== null && { DirectoryId : input . DirectoryId } ) , ... ( input . RootVolumeEncryptionEnabled !== undefined && input . RootVolumeEncryptionEnabled !== null && { RootVolumeEncryptionEnabled : input . RootVolumeEncryptionEnabled } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_json1_1TagList ( input . Tags , context ) } ) , ... ( input . UserName !== undefined && input . UserName !== null && { UserName : input . UserName } ) , ... ( input . UserVolumeEncryptionEnabled !== undefined && input . UserVolumeEncryptionEnabled !== null && { UserVolumeEncryptionEnabled : input . UserVolumeEncryptionEnabled } ) , ... ( input . VolumeEncryptionKey !== undefined && input . VolumeEncryptionKey !== null && { VolumeEncryptionKey : input . VolumeEncryptionKey } ) , ... ( input . WorkspaceProperties !== undefined && input . WorkspaceProperties !== null && { WorkspaceProperties : serializeAws_json1_1WorkspaceProperties ( input . WorkspaceProperties , context ) , } ) , } ; } ; const serializeAws_json1_1WorkspaceRequestList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_json1_1WorkspaceRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AccessDeniedException = ( output , context ) : AccessDeniedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1AccountModification = ( output , context ) : AccountModification => { return { DedicatedTenancyManagementCidrRange : __expectString ( output . DedicatedTenancyManagementCidrRange ) , DedicatedTenancySupport : __expectString ( output . DedicatedTenancySupport ) , ErrorCode : __expectString ( output . ErrorCode ) , ErrorMessage : __expectString ( output . ErrorMessage ) , ModificationState : __expectString ( output . ModificationState ) , StartTime : output . StartTime !== undefined && output . StartTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . StartTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1AccountModificationList = ( output , context ) : AccountModification [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1AccountModification ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1AssociateConnectionAliasResult = ( output , context ) : AssociateConnectionAliasResult => { return { ConnectionIdentifier : __expectString ( output . ConnectionIdentifier ) , } as any ; } ; const deserializeAws_json1_1AssociateIpGroupsResult = ( output , context ) : AssociateIpGroupsResult => { return { } as any ; } ; const deserializeAws_json1_1AuthorizeIpRulesResult = ( output , context ) : AuthorizeIpRulesResult => { return { } as any ; } ; const deserializeAws_json1_1BundleList = ( output , context ) : WorkspaceBundle [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1WorkspaceBundle ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ClientProperties = ( output , context ) : ClientProperties => { return { ReconnectEnabled : __expectString ( output . ReconnectEnabled ) , } as any ; } ; const deserializeAws_json1_1ClientPropertiesList = ( output , context ) : ClientPropertiesResult [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ClientPropertiesResult ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ClientPropertiesResult = ( output , context ) : ClientPropertiesResult => { return { ClientProperties : output . ClientProperties !== undefined && output . ClientProperties !== null ? deserializeAws_json1_1ClientProperties ( output . ClientProperties , context ) : undefined , ResourceId : __expectString ( output . ResourceId ) , } as any ; } ; const deserializeAws_json1_1ComputeType = ( output , context ) : ComputeType => { return { Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_json1_1ConnectionAlias = ( output , context ) : ConnectionAlias => { return { AliasId : __expectString ( output . AliasId ) , Associations : output . Associations !== undefined && output . Associations !== null ? deserializeAws_json1_1ConnectionAliasAssociationList ( output . Associations , context ) : undefined , ConnectionString : __expectString ( output . ConnectionString ) , OwnerAccountId : __expectString ( output . OwnerAccountId ) , State : __expectString ( output . State ) , } as any ; } ; const deserializeAws_json1_1ConnectionAliasAssociation = ( output , context ) : ConnectionAliasAssociation => { return { AssociatedAccountId : __expectString ( output . AssociatedAccountId ) , AssociationStatus : __expectString ( output . AssociationStatus ) , ConnectionIdentifier : __expectString ( output . ConnectionIdentifier ) , ResourceId : __expectString ( output . ResourceId ) , } as any ; } ; const deserializeAws_json1_1ConnectionAliasAssociationList = ( output , context ) : ConnectionAliasAssociation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ConnectionAliasAssociation ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ConnectionAliasList = ( output , context ) : ConnectionAlias [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ConnectionAlias ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ConnectionAliasPermission = ( output , context ) : ConnectionAliasPermission => { return { AllowAssociation : __expectBoolean ( output . AllowAssociation ) , SharedAccountId : __expectString ( output . SharedAccountId ) , } as any ; } ; const deserializeAws_json1_1ConnectionAliasPermissions = ( output , context ) : ConnectionAliasPermission [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ConnectionAliasPermission ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1CopyWorkspaceImageResult = ( output , context ) : CopyWorkspaceImageResult => { return { ImageId : __expectString ( output . ImageId ) , } as any ; } ; const deserializeAws_json1_1CreateConnectionAliasResult = ( output , context ) : CreateConnectionAliasResult => { return { AliasId : __expectString ( output . AliasId ) , } as any ; } ; const deserializeAws_json1_1CreateIpGroupResult = ( output , context ) : CreateIpGroupResult => { return { GroupId : __expectString ( output . GroupId ) , } as any ; } ; const deserializeAws_json1_1CreateTagsResult = ( output , context ) : CreateTagsResult => { return { } as any ; } ; const deserializeAws_json1_1CreateUpdatedWorkspaceImageResult = ( output , context ) : CreateUpdatedWorkspaceImageResult => { return { ImageId : __expectString ( output . ImageId ) , } as any ; } ; const deserializeAws_json1_1CreateWorkspaceBundleResult = ( output , context ) : CreateWorkspaceBundleResult => { return { WorkspaceBundle : output . WorkspaceBundle !== undefined && output . WorkspaceBundle !== null ? deserializeAws_json1_1WorkspaceBundle ( output . WorkspaceBundle , context ) : undefined , } as any ; } ; const deserializeAws_json1_1CreateWorkspacesResult = ( output , context ) : CreateWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedCreateWorkspaceRequests ( output . FailedRequests , context ) : undefined , PendingRequests : output . PendingRequests !== undefined && output . PendingRequests !== null ? deserializeAws_json1_1WorkspaceList ( output . PendingRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DedicatedTenancyCidrRangeList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1DefaultWorkspaceCreationProperties = ( output , context ) : DefaultWorkspaceCreationProperties => { return { CustomSecurityGroupId : __expectString ( output . CustomSecurityGroupId ) , DefaultOu : __expectString ( output . DefaultOu ) , EnableInternetAccess : __expectBoolean ( output . EnableInternetAccess ) , EnableMaintenanceMode : __expectBoolean ( output . EnableMaintenanceMode ) , EnableWorkDocs : __expectBoolean ( output . EnableWorkDocs ) , UserEnabledAsLocalAdministrator : __expectBoolean ( output . UserEnabledAsLocalAdministrator ) , } as any ; } ; const deserializeAws_json1_1DeleteConnectionAliasResult = ( output , context ) : DeleteConnectionAliasResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteIpGroupResult = ( output , context ) : DeleteIpGroupResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteTagsResult = ( output , context ) : DeleteTagsResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteWorkspaceBundleResult = ( output , context ) : DeleteWorkspaceBundleResult => { return { } as any ; } ; const deserializeAws_json1_1DeleteWorkspaceImageResult = ( output , context ) : DeleteWorkspaceImageResult => { return { } as any ; } ; const deserializeAws_json1_1DeregisterWorkspaceDirectoryResult = ( output , context ) : DeregisterWorkspaceDirectoryResult => { return { } as any ; } ; const deserializeAws_json1_1DescribeAccountModificationsResult = ( output , context ) : DescribeAccountModificationsResult => { return { AccountModifications : output . AccountModifications !== undefined && output . AccountModifications !== null ? deserializeAws_json1_1AccountModificationList ( output . AccountModifications , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeAccountResult = ( output , context ) : DescribeAccountResult => { return { DedicatedTenancyManagementCidrRange : __expectString ( output . DedicatedTenancyManagementCidrRange ) , DedicatedTenancySupport : __expectString ( output . DedicatedTenancySupport ) , } as any ; } ; const deserializeAws_json1_1DescribeClientPropertiesResult = ( output , context ) : DescribeClientPropertiesResult => { return { ClientPropertiesList : output . ClientPropertiesList !== undefined && output . ClientPropertiesList !== null ? deserializeAws_json1_1ClientPropertiesList ( output . ClientPropertiesList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeConnectionAliasesResult = ( output , context ) : DescribeConnectionAliasesResult => { return { ConnectionAliases : output . ConnectionAliases !== undefined && output . ConnectionAliases !== null ? deserializeAws_json1_1ConnectionAliasList ( output . ConnectionAliases , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeConnectionAliasPermissionsResult = ( output , context ) : DescribeConnectionAliasPermissionsResult => { return { AliasId : __expectString ( output . AliasId ) , ConnectionAliasPermissions : output . ConnectionAliasPermissions !== undefined && output . ConnectionAliasPermissions !== null ? deserializeAws_json1_1ConnectionAliasPermissions ( output . ConnectionAliasPermissions , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeIpGroupsResult = ( output , context ) : DescribeIpGroupsResult => { return { NextToken : __expectString ( output . NextToken ) , Result : output . Result !== undefined && output . Result !== null ? deserializeAws_json1_1WorkspacesIpGroupsList ( output . Result , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeTagsResult = ( output , context ) : DescribeTagsResult => { return { TagList : output . TagList !== undefined && output . TagList !== null ? deserializeAws_json1_1TagList ( output . TagList , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeWorkspaceBundlesResult = ( output , context ) : DescribeWorkspaceBundlesResult => { return { Bundles : output . Bundles !== undefined && output . Bundles !== null ? deserializeAws_json1_1BundleList ( output . Bundles , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeWorkspaceDirectoriesResult = ( output , context ) : DescribeWorkspaceDirectoriesResult => { return { Directories : output . Directories !== undefined && output . Directories !== null ? deserializeAws_json1_1DirectoryList ( output . Directories , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeWorkspaceImagePermissionsResult = ( output , context ) : DescribeWorkspaceImagePermissionsResult => { return { ImageId : __expectString ( output . ImageId ) , ImagePermissions : output . ImagePermissions !== undefined && output . ImagePermissions !== null ? deserializeAws_json1_1ImagePermissions ( output . ImagePermissions , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeWorkspaceImagesResult = ( output , context ) : DescribeWorkspaceImagesResult => { return { Images : output . Images !== undefined && output . Images !== null ? deserializeAws_json1_1WorkspaceImageList ( output . Images , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1DescribeWorkspacesConnectionStatusResult = ( output , context ) : DescribeWorkspacesConnectionStatusResult => { return { NextToken : __expectString ( output . NextToken ) , WorkspacesConnectionStatus : output . WorkspacesConnectionStatus !== undefined && output . WorkspacesConnectionStatus !== null ? deserializeAws_json1_1WorkspaceConnectionStatusList ( output . WorkspacesConnectionStatus , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeWorkspaceSnapshotsResult = ( output , context ) : DescribeWorkspaceSnapshotsResult => { return { RebuildSnapshots : output . RebuildSnapshots !== undefined && output . RebuildSnapshots !== null ? deserializeAws_json1_1SnapshotList ( output . RebuildSnapshots , context ) : undefined , RestoreSnapshots : output . RestoreSnapshots !== undefined && output . RestoreSnapshots !== null ? deserializeAws_json1_1SnapshotList ( output . RestoreSnapshots , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DescribeWorkspacesResult = ( output , context ) : DescribeWorkspacesResult => { return { NextToken : __expectString ( output . NextToken ) , Workspaces : output . Workspaces !== undefined && output . Workspaces !== null ? deserializeAws_json1_1WorkspaceList ( output . Workspaces , context ) : undefined , } as any ; } ; const deserializeAws_json1_1DirectoryList = ( output , context ) : WorkspaceDirectory [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1WorkspaceDirectory ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1DisassociateConnectionAliasResult = ( output , context ) : DisassociateConnectionAliasResult => { return { } as any ; } ; const deserializeAws_json1_1DisassociateIpGroupsResult = ( output , context ) : DisassociateIpGroupsResult => { return { } as any ; } ; const deserializeAws_json1_1DnsIpAddresses = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1FailedCreateWorkspaceRequest = ( output , context ) : FailedCreateWorkspaceRequest => { return { ErrorCode : __expectString ( output . ErrorCode ) , ErrorMessage : __expectString ( output . ErrorMessage ) , WorkspaceRequest : output . WorkspaceRequest !== undefined && output . WorkspaceRequest !== null ? deserializeAws_json1_1WorkspaceRequest ( output . WorkspaceRequest , context ) : undefined , } as any ; } ; const deserializeAws_json1_1FailedCreateWorkspaceRequests = ( output , context ) : FailedCreateWorkspaceRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedCreateWorkspaceRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedRebootWorkspaceRequests = ( output , context ) : FailedWorkspaceChangeRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedWorkspaceChangeRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedRebuildWorkspaceRequests = ( output , context ) : FailedWorkspaceChangeRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedWorkspaceChangeRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedStartWorkspaceRequests = ( output , context ) : FailedWorkspaceChangeRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedWorkspaceChangeRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedStopWorkspaceRequests = ( output , context ) : FailedWorkspaceChangeRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedWorkspaceChangeRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedTerminateWorkspaceRequests = ( output , context ) : FailedWorkspaceChangeRequest [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1FailedWorkspaceChangeRequest ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1FailedWorkspaceChangeRequest = ( output , context ) : FailedWorkspaceChangeRequest => { return { ErrorCode : __expectString ( output . ErrorCode ) , ErrorMessage : __expectString ( output . ErrorMessage ) , WorkspaceId : __expectString ( output . WorkspaceId ) , } as any ; } ; const deserializeAws_json1_1ImagePermission = ( output , context ) : ImagePermission => { return { SharedAccountId : __expectString ( output . SharedAccountId ) , } as any ; } ; const deserializeAws_json1_1ImagePermissions = ( output , context ) : ImagePermission [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ImagePermission ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ImportWorkspaceImageResult = ( output , context ) : ImportWorkspaceImageResult => { return { ImageId : __expectString ( output . ImageId ) , } as any ; } ; const deserializeAws_json1_1InvalidParameterValuesException = ( output , context ) : InvalidParameterValuesException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1InvalidResourceStateException = ( output , context ) : InvalidResourceStateException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1IpGroupIdList = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1IpRuleItem = ( output , context ) : IpRuleItem => { return { ipRule : __expectString ( output . ipRule ) , ruleDesc : __expectString ( output . ruleDesc ) , } as any ; } ; const deserializeAws_json1_1IpRuleList = ( output , context ) : IpRuleItem [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1IpRuleItem ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ListAvailableManagementCidrRangesResult = ( output , context ) : ListAvailableManagementCidrRangesResult => { return { ManagementCidrRanges : output . ManagementCidrRanges !== undefined && output . ManagementCidrRanges !== null ? deserializeAws_json1_1DedicatedTenancyCidrRangeList ( output . ManagementCidrRanges , context ) : undefined , NextToken : __expectString ( output . NextToken ) , } as any ; } ; const deserializeAws_json1_1MigrateWorkspaceResult = ( output , context ) : MigrateWorkspaceResult => { return { SourceWorkspaceId : __expectString ( output . SourceWorkspaceId ) , TargetWorkspaceId : __expectString ( output . TargetWorkspaceId ) , } as any ; } ; const deserializeAws_json1_1ModificationState = ( output , context ) : ModificationState => { return { Resource : __expectString ( output . Resource ) , State : __expectString ( output . State ) , } as any ; } ; const deserializeAws_json1_1ModificationStateList = ( output , context ) : ModificationState [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1ModificationState ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1ModifyAccountResult = ( output , context ) : ModifyAccountResult => { return { } as any ; } ; const deserializeAws_json1_1ModifyClientPropertiesResult = ( output , context ) : ModifyClientPropertiesResult => { return { } as any ; } ; const deserializeAws_json1_1ModifySelfservicePermissionsResult = ( output , context ) : ModifySelfservicePermissionsResult => { return { } as any ; } ; const deserializeAws_json1_1ModifyWorkspaceAccessPropertiesResult = ( output , context ) : ModifyWorkspaceAccessPropertiesResult => { return { } as any ; } ; const deserializeAws_json1_1ModifyWorkspaceCreationPropertiesResult = ( output , context ) : ModifyWorkspaceCreationPropertiesResult => { return { } as any ; } ; const deserializeAws_json1_1ModifyWorkspacePropertiesResult = ( output , context ) : ModifyWorkspacePropertiesResult => { return { } as any ; } ; const deserializeAws_json1_1ModifyWorkspaceStateResult = ( output , context ) : ModifyWorkspaceStateResult => { return { } as any ; } ; const deserializeAws_json1_1OperatingSystem = ( output , context ) : OperatingSystem => { return { Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_json1_1OperationInProgressException = ( output , context ) : OperationInProgressException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1OperationNotSupportedException = ( output , context ) : OperationNotSupportedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RebootWorkspacesResult = ( output , context ) : RebootWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedRebootWorkspaceRequests ( output . FailedRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1RebuildWorkspacesResult = ( output , context ) : RebuildWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedRebuildWorkspaceRequests ( output . FailedRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1RegisterWorkspaceDirectoryResult = ( output , context ) : RegisterWorkspaceDirectoryResult => { return { } as any ; } ; const deserializeAws_json1_1ResourceAlreadyExistsException = ( output , context ) : ResourceAlreadyExistsException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceAssociatedException = ( output , context ) : ResourceAssociatedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceCreationFailedException = ( output , context ) : ResourceCreationFailedException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceLimitExceededException = ( output , context ) : ResourceLimitExceededException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceNotFoundException = ( output , context ) : ResourceNotFoundException => { return { ResourceId : __expectString ( output . ResourceId ) , message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1ResourceUnavailableException = ( output , context ) : ResourceUnavailableException => { return { ResourceId : __expectString ( output . ResourceId ) , message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1RestoreWorkspaceResult = ( output , context ) : RestoreWorkspaceResult => { return { } as any ; } ; const deserializeAws_json1_1RevokeIpRulesResult = ( output , context ) : RevokeIpRulesResult => { return { } as any ; } ; const deserializeAws_json1_1RootStorage = ( output , context ) : RootStorage => { return { Capacity : __expectString ( output . Capacity ) , } as any ; } ; const deserializeAws_json1_1SelfservicePermissions = ( output , context ) : SelfservicePermissions => { return { ChangeComputeType : __expectString ( output . ChangeComputeType ) , IncreaseVolumeSize : __expectString ( output . IncreaseVolumeSize ) , RebuildWorkspace : __expectString ( output . RebuildWorkspace ) , RestartWorkspace : __expectString ( output . RestartWorkspace ) , SwitchRunningMode : __expectString ( output . SwitchRunningMode ) , } as any ; } ; const deserializeAws_json1_1Snapshot = ( output , context ) : Snapshot => { return { SnapshotTime : output . SnapshotTime !== undefined && output . SnapshotTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . SnapshotTime ) ) ) : undefined , } as any ; } ; const deserializeAws_json1_1SnapshotList = ( output , context ) : Snapshot [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Snapshot ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1StartWorkspacesResult = ( output , context ) : StartWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedStartWorkspaceRequests ( output . FailedRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1StopWorkspacesResult = ( output , context ) : StopWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedStopWorkspaceRequests ( output . FailedRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1SubnetIds = ( output , context ) : string [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_json1_1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_json1_1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1TerminateWorkspacesResult = ( output , context ) : TerminateWorkspacesResult => { return { FailedRequests : output . FailedRequests !== undefined && output . FailedRequests !== null ? deserializeAws_json1_1FailedTerminateWorkspaceRequests ( output . FailedRequests , context ) : undefined , } as any ; } ; const deserializeAws_json1_1UnsupportedNetworkConfigurationException = ( output , context ) : UnsupportedNetworkConfigurationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UnsupportedWorkspaceConfigurationException = ( output , context ) : UnsupportedWorkspaceConfigurationException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1UpdateConnectionAliasPermissionResult = ( output , context ) : UpdateConnectionAliasPermissionResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateResult = ( output , context ) : UpdateResult => { return { Description : __expectString ( output . Description ) , UpdateAvailable : __expectBoolean ( output . UpdateAvailable ) , } as any ; } ; const deserializeAws_json1_1UpdateRulesOfIpGroupResult = ( output , context ) : UpdateRulesOfIpGroupResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateWorkspaceBundleResult = ( output , context ) : UpdateWorkspaceBundleResult => { return { } as any ; } ; const deserializeAws_json1_1UpdateWorkspaceImagePermissionResult = ( output , context ) : UpdateWorkspaceImagePermissionResult => { return { } as any ; } ; const deserializeAws_json1_1UserStorage = ( output , context ) : UserStorage => { return { Capacity : __expectString ( output . Capacity ) , } as any ; } ; const deserializeAws_json1_1Workspace = ( output , context ) : Workspace => { return { BundleId : __expectString ( output . BundleId ) , ComputerName : __expectString ( output . ComputerName ) , DirectoryId : __expectString ( output . DirectoryId ) , ErrorCode : __expectString ( output . ErrorCode ) , ErrorMessage : __expectString ( output . ErrorMessage ) , IpAddress : __expectString ( output . IpAddress ) , ModificationStates : output . ModificationStates !== undefined && output . ModificationStates !== null ? deserializeAws_json1_1ModificationStateList ( output . ModificationStates , context ) : undefined , RootVolumeEncryptionEnabled : __expectBoolean ( output . RootVolumeEncryptionEnabled ) , State : __expectString ( output . State ) , SubnetId : __expectString ( output . SubnetId ) , UserName : __expectString ( output . UserName ) , UserVolumeEncryptionEnabled : __expectBoolean ( output . UserVolumeEncryptionEnabled ) , VolumeEncryptionKey : __expectString ( output . VolumeEncryptionKey ) , WorkspaceId : __expectString ( output . WorkspaceId ) , WorkspaceProperties : output . WorkspaceProperties !== undefined && output . WorkspaceProperties !== null ? deserializeAws_json1_1WorkspaceProperties ( output . WorkspaceProperties , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspaceAccessProperties = ( output , context ) : WorkspaceAccessProperties => { return { DeviceTypeAndroid : __expectString ( output . DeviceTypeAndroid ) , DeviceTypeChromeOs : __expectString ( output . DeviceTypeChromeOs ) , DeviceTypeIos : __expectString ( output . DeviceTypeIos ) , DeviceTypeLinux : __expectString ( output . DeviceTypeLinux ) , DeviceTypeOsx : __expectString ( output . DeviceTypeOsx ) , DeviceTypeWeb : __expectString ( output . DeviceTypeWeb ) , DeviceTypeWindows : __expectString ( output . DeviceTypeWindows ) , DeviceTypeZeroClient : __expectString ( output . DeviceTypeZeroClient ) , } as any ; } ; const deserializeAws_json1_1WorkspaceBundle = ( output , context ) : WorkspaceBundle => { return { BundleId : __expectString ( output . BundleId ) , ComputeType : output . ComputeType !== undefined && output . ComputeType !== null ? deserializeAws_json1_1ComputeType ( output . ComputeType , context ) : undefined , CreationTime : output . CreationTime !== undefined && output . CreationTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreationTime ) ) ) : undefined , Description : __expectString ( output . Description ) , ImageId : __expectString ( output . ImageId ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , Owner : __expectString ( output . Owner ) , RootStorage : output . RootStorage !== undefined && output . RootStorage !== null ? deserializeAws_json1_1RootStorage ( output . RootStorage , context ) : undefined , UserStorage : output . UserStorage !== undefined && output . UserStorage !== null ? deserializeAws_json1_1UserStorage ( output . UserStorage , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspaceConnectionStatus = ( output , context ) : WorkspaceConnectionStatus => { return { ConnectionState : __expectString ( output . ConnectionState ) , ConnectionStateCheckTimestamp : output . ConnectionStateCheckTimestamp !== undefined && output . ConnectionStateCheckTimestamp !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . ConnectionStateCheckTimestamp ) ) ) : undefined , LastKnownUserConnectionTimestamp : output . LastKnownUserConnectionTimestamp !== undefined && output . LastKnownUserConnectionTimestamp !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastKnownUserConnectionTimestamp ) ) ) : undefined , WorkspaceId : __expectString ( output . WorkspaceId ) , } as any ; } ; const deserializeAws_json1_1WorkspaceConnectionStatusList = ( output , context ) : WorkspaceConnectionStatus [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1WorkspaceConnectionStatus ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1WorkspaceDirectory = ( output , context ) : WorkspaceDirectory => { return { Alias : __expectString ( output . Alias ) , CustomerUserName : __expectString ( output . CustomerUserName ) , DirectoryId : __expectString ( output . DirectoryId ) , DirectoryName : __expectString ( output . DirectoryName ) , DirectoryType : __expectString ( output . DirectoryType ) , DnsIpAddresses : output . DnsIpAddresses !== undefined && output . DnsIpAddresses !== null ? deserializeAws_json1_1DnsIpAddresses ( output . DnsIpAddresses , context ) : undefined , IamRoleId : __expectString ( output . IamRoleId ) , RegistrationCode : __expectString ( output . RegistrationCode ) , SelfservicePermissions : output . SelfservicePermissions !== undefined && output . SelfservicePermissions !== null ? deserializeAws_json1_1SelfservicePermissions ( output . SelfservicePermissions , context ) : undefined , State : __expectString ( output . State ) , SubnetIds : output . SubnetIds !== undefined && output . SubnetIds !== null ? deserializeAws_json1_1SubnetIds ( output . SubnetIds , context ) : undefined , Tenancy : __expectString ( output . Tenancy ) , WorkspaceAccessProperties : output . WorkspaceAccessProperties !== undefined && output . WorkspaceAccessProperties !== null ? deserializeAws_json1_1WorkspaceAccessProperties ( output . WorkspaceAccessProperties , context ) : undefined , WorkspaceCreationProperties : output . WorkspaceCreationProperties !== undefined && output . WorkspaceCreationProperties !== null ? deserializeAws_json1_1DefaultWorkspaceCreationProperties ( output . WorkspaceCreationProperties , context ) : undefined , WorkspaceSecurityGroupId : __expectString ( output . WorkspaceSecurityGroupId ) , ipGroupIds : output . ipGroupIds !== undefined && output . ipGroupIds !== null ? deserializeAws_json1_1IpGroupIdList ( output . ipGroupIds , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspaceImage = ( output , context ) : WorkspaceImage => { return { Created : output . Created !== undefined && output . Created !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . Created ) ) ) : undefined , Description : __expectString ( output . Description ) , ErrorCode : __expectString ( output . ErrorCode ) , ErrorMessage : __expectString ( output . ErrorMessage ) , ImageId : __expectString ( output . ImageId ) , Name : __expectString ( output . Name ) , OperatingSystem : output . OperatingSystem !== undefined && output . OperatingSystem !== null ? deserializeAws_json1_1OperatingSystem ( output . OperatingSystem , context ) : undefined , OwnerAccountId : __expectString ( output . OwnerAccountId ) , RequiredTenancy : __expectString ( output . RequiredTenancy ) , State : __expectString ( output . State ) , Updates : output . Updates !== undefined && output . Updates !== null ? deserializeAws_json1_1UpdateResult ( output . Updates , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspaceImageList = ( output , context ) : WorkspaceImage [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1WorkspaceImage ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1WorkspaceList = ( output , context ) : Workspace [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1Workspace ( entry , context ) ; } ) ; } ; const deserializeAws_json1_1WorkspaceProperties = ( output , context ) : WorkspaceProperties => { return { ComputeTypeName : __expectString ( output . ComputeTypeName ) , RootVolumeSizeGib : __expectInt32 ( output . RootVolumeSizeGib ) , RunningMode : __expectString ( output . RunningMode ) , RunningModeAutoStopTimeoutInMinutes : __expectInt32 ( output . RunningModeAutoStopTimeoutInMinutes ) , UserVolumeSizeGib : __expectInt32 ( output . UserVolumeSizeGib ) , } as any ; } ; const deserializeAws_json1_1WorkspaceRequest = ( output , context ) : WorkspaceRequest => { return { BundleId : __expectString ( output . BundleId ) , DirectoryId : __expectString ( output . DirectoryId ) , RootVolumeEncryptionEnabled : __expectBoolean ( output . RootVolumeEncryptionEnabled ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_json1_1TagList ( output . Tags , context ) : undefined , UserName : __expectString ( output . UserName ) , UserVolumeEncryptionEnabled : __expectBoolean ( output . UserVolumeEncryptionEnabled ) , VolumeEncryptionKey : __expectString ( output . VolumeEncryptionKey ) , WorkspaceProperties : output . WorkspaceProperties !== undefined && output . WorkspaceProperties !== null ? deserializeAws_json1_1WorkspaceProperties ( output . WorkspaceProperties , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspacesDefaultRoleNotFoundException = ( output , context ) : WorkspacesDefaultRoleNotFoundException => { return { message : __expectString ( output . message ) , } as any ; } ; const deserializeAws_json1_1WorkspacesIpGroup = ( output , context ) : WorkspacesIpGroup => { return { groupDesc : __expectString ( output . groupDesc ) , groupId : __expectString ( output . groupId ) , groupName : __expectString ( output . groupName ) , userRules : output . userRules !== undefined && output . userRules !== null ? deserializeAws_json1_1IpRuleList ( output . userRules , context ) : undefined , } as any ; } ; const deserializeAws_json1_1WorkspacesIpGroupsList = ( output , context ) : WorkspacesIpGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_json1_1WorkspacesIpGroup ( entry , context ) ; } ) ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const buildHttpRpcRequest = async ( context , headers , path , resolvedHostname , body ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const contents = { protocol , hostname , port , method : "POST" , path : basePath . endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) + path : basePath + path , headers , } ; if ( resolvedHostname !== undefined ) { contents . hostname = resolvedHostname ; } if ( body !== undefined ) { contents . body = body ; } return new __HttpRequest ( contents ) ; } ; const parseBody = ( streamBody , context ) : any => collectBodyString ( streamBody , context ) . then ( ( encoded ) => { if ( encoded . length ) { return JSON . parse ( encoded ) ; } return { } ; } ) ; /**
 * Load an error code for the aws.rest-json-1.1 protocol.
 */ const loadRestJsonErrorCode = ( output , data ) : string => { const findKey = ( object , key ) => Object . keys ( object ) . find ( ( k ) => k . toLowerCase ( ) === key . toLowerCase ( ) ) ; const sanitizeErrorCode = ( rawValue ) : string => { let cleanValue = rawValue ; if ( cleanValue . indexOf ( ":" ) >= 0 ) { cleanValue = cleanValue . split ( ":" ) [ 0 ] ; } if ( cleanValue . indexOf ( "#" ) >= 0 ) { cleanValue = cleanValue . split ( "#" ) [ 1 ] ; } return cleanValue ; } ; const headerKey = findKey ( output . headers , "x-amzn-errortype" ) ; if ( headerKey !== undefined ) { return sanitizeErrorCode ( output . headers [ headerKey ] ) ; } if ( data . code !== undefined ) { return sanitizeErrorCode ( data . code ) ; } if ( data [ "__type" ] !== undefined ) { return sanitizeErrorCode ( data [ "__type" ] ) ; } return "" ; } ;