import { HttpRequest as __HttpRequest , HttpResponse as __HttpResponse } from "@aws-sdk/protocol-http" ; import { expectBoolean as __expectBoolean , expectInt32 as __expectInt32 , expectLong as __expectLong , expectNonNull as __expectNonNull , expectNumber as __expectNumber , expectObject as __expectObject , expectString as __expectString , expectUnion as __expectUnion , extendedEncodeURIComponent as __extendedEncodeURIComponent , parseEpochTimestamp as __parseEpochTimestamp , serializeFloat as __serializeFloat , } from "@aws-sdk/smithy-client" ; import { Endpoint as __Endpoint , MetadataBearer as __MetadataBearer , ResponseMetadata as __ResponseMetadata , SerdeContext as __SerdeContext , SmithyException as __SmithyException , } from "@aws-sdk/types" ; import { CancelIngestionCommandInput , CancelIngestionCommandOutput } from "../commands/CancelIngestionCommand" ; import { CreateAccountCustomizationCommandInput , CreateAccountCustomizationCommandOutput , } from "../commands/CreateAccountCustomizationCommand" ; import { CreateAnalysisCommandInput , CreateAnalysisCommandOutput } from "../commands/CreateAnalysisCommand" ; import { CreateDashboardCommandInput , CreateDashboardCommandOutput } from "../commands/CreateDashboardCommand" ; import { CreateDataSetCommandInput , CreateDataSetCommandOutput } from "../commands/CreateDataSetCommand" ; import { CreateDataSourceCommandInput , CreateDataSourceCommandOutput } from "../commands/CreateDataSourceCommand" ; import { CreateFolderCommandInput , CreateFolderCommandOutput } from "../commands/CreateFolderCommand" ; import { CreateFolderMembershipCommandInput , CreateFolderMembershipCommandOutput , } from "../commands/CreateFolderMembershipCommand" ; import { CreateGroupCommandInput , CreateGroupCommandOutput } from "../commands/CreateGroupCommand" ; import { CreateGroupMembershipCommandInput , CreateGroupMembershipCommandOutput , } from "../commands/CreateGroupMembershipCommand" ; import { CreateIAMPolicyAssignmentCommandInput , CreateIAMPolicyAssignmentCommandOutput , } from "../commands/CreateIAMPolicyAssignmentCommand" ; import { CreateIngestionCommandInput , CreateIngestionCommandOutput } from "../commands/CreateIngestionCommand" ; import { CreateNamespaceCommandInput , CreateNamespaceCommandOutput } from "../commands/CreateNamespaceCommand" ; import { CreateTemplateAliasCommandInput , CreateTemplateAliasCommandOutput , } from "../commands/CreateTemplateAliasCommand" ; import { CreateTemplateCommandInput , CreateTemplateCommandOutput } from "../commands/CreateTemplateCommand" ; import { CreateThemeAliasCommandInput , CreateThemeAliasCommandOutput } from "../commands/CreateThemeAliasCommand" ; import { CreateThemeCommandInput , CreateThemeCommandOutput } from "../commands/CreateThemeCommand" ; import { DeleteAccountCustomizationCommandInput , DeleteAccountCustomizationCommandOutput , } from "../commands/DeleteAccountCustomizationCommand" ; import { DeleteAnalysisCommandInput , DeleteAnalysisCommandOutput } from "../commands/DeleteAnalysisCommand" ; import { DeleteDashboardCommandInput , DeleteDashboardCommandOutput } from "../commands/DeleteDashboardCommand" ; import { DeleteDataSetCommandInput , DeleteDataSetCommandOutput } from "../commands/DeleteDataSetCommand" ; import { DeleteDataSourceCommandInput , DeleteDataSourceCommandOutput } from "../commands/DeleteDataSourceCommand" ; import { DeleteFolderCommandInput , DeleteFolderCommandOutput } from "../commands/DeleteFolderCommand" ; import { DeleteFolderMembershipCommandInput , DeleteFolderMembershipCommandOutput , } from "../commands/DeleteFolderMembershipCommand" ; import { DeleteGroupCommandInput , DeleteGroupCommandOutput } from "../commands/DeleteGroupCommand" ; import { DeleteGroupMembershipCommandInput , DeleteGroupMembershipCommandOutput , } from "../commands/DeleteGroupMembershipCommand" ; import { DeleteIAMPolicyAssignmentCommandInput , DeleteIAMPolicyAssignmentCommandOutput , } from "../commands/DeleteIAMPolicyAssignmentCommand" ; import { DeleteNamespaceCommandInput , DeleteNamespaceCommandOutput } from "../commands/DeleteNamespaceCommand" ; import { DeleteTemplateAliasCommandInput , DeleteTemplateAliasCommandOutput , } from "../commands/DeleteTemplateAliasCommand" ; import { DeleteTemplateCommandInput , DeleteTemplateCommandOutput } from "../commands/DeleteTemplateCommand" ; import { DeleteThemeAliasCommandInput , DeleteThemeAliasCommandOutput } from "../commands/DeleteThemeAliasCommand" ; import { DeleteThemeCommandInput , DeleteThemeCommandOutput } from "../commands/DeleteThemeCommand" ; import { DeleteUserByPrincipalIdCommandInput , DeleteUserByPrincipalIdCommandOutput , } from "../commands/DeleteUserByPrincipalIdCommand" ; import { DeleteUserCommandInput , DeleteUserCommandOutput } from "../commands/DeleteUserCommand" ; import { DescribeAccountCustomizationCommandInput , DescribeAccountCustomizationCommandOutput , } from "../commands/DescribeAccountCustomizationCommand" ; import { DescribeAccountSettingsCommandInput , DescribeAccountSettingsCommandOutput , } from "../commands/DescribeAccountSettingsCommand" ; import { DescribeAnalysisCommandInput , DescribeAnalysisCommandOutput } from "../commands/DescribeAnalysisCommand" ; import { DescribeAnalysisPermissionsCommandInput , DescribeAnalysisPermissionsCommandOutput , } from "../commands/DescribeAnalysisPermissionsCommand" ; import { DescribeDashboardCommandInput , DescribeDashboardCommandOutput } from "../commands/DescribeDashboardCommand" ; import { DescribeDashboardPermissionsCommandInput , DescribeDashboardPermissionsCommandOutput , } from "../commands/DescribeDashboardPermissionsCommand" ; import { DescribeDataSetCommandInput , DescribeDataSetCommandOutput } from "../commands/DescribeDataSetCommand" ; import { DescribeDataSetPermissionsCommandInput , DescribeDataSetPermissionsCommandOutput , } from "../commands/DescribeDataSetPermissionsCommand" ; import { DescribeDataSourceCommandInput , DescribeDataSourceCommandOutput } from "../commands/DescribeDataSourceCommand" ; import { DescribeDataSourcePermissionsCommandInput , DescribeDataSourcePermissionsCommandOutput , } from "../commands/DescribeDataSourcePermissionsCommand" ; import { DescribeFolderCommandInput , DescribeFolderCommandOutput } from "../commands/DescribeFolderCommand" ; import { DescribeFolderPermissionsCommandInput , DescribeFolderPermissionsCommandOutput , } from "../commands/DescribeFolderPermissionsCommand" ; import { DescribeFolderResolvedPermissionsCommandInput , DescribeFolderResolvedPermissionsCommandOutput , } from "../commands/DescribeFolderResolvedPermissionsCommand" ; import { DescribeGroupCommandInput , DescribeGroupCommandOutput } from "../commands/DescribeGroupCommand" ; import { DescribeIAMPolicyAssignmentCommandInput , DescribeIAMPolicyAssignmentCommandOutput , } from "../commands/DescribeIAMPolicyAssignmentCommand" ; import { DescribeIngestionCommandInput , DescribeIngestionCommandOutput } from "../commands/DescribeIngestionCommand" ; import { DescribeIpRestrictionCommandInput , DescribeIpRestrictionCommandOutput , } from "../commands/DescribeIpRestrictionCommand" ; import { DescribeNamespaceCommandInput , DescribeNamespaceCommandOutput } from "../commands/DescribeNamespaceCommand" ; import { DescribeTemplateAliasCommandInput , DescribeTemplateAliasCommandOutput , } from "../commands/DescribeTemplateAliasCommand" ; import { DescribeTemplateCommandInput , DescribeTemplateCommandOutput } from "../commands/DescribeTemplateCommand" ; import { DescribeTemplatePermissionsCommandInput , DescribeTemplatePermissionsCommandOutput , } from "../commands/DescribeTemplatePermissionsCommand" ; import { DescribeThemeAliasCommandInput , DescribeThemeAliasCommandOutput } from "../commands/DescribeThemeAliasCommand" ; import { DescribeThemeCommandInput , DescribeThemeCommandOutput } from "../commands/DescribeThemeCommand" ; import { DescribeThemePermissionsCommandInput , DescribeThemePermissionsCommandOutput , } from "../commands/DescribeThemePermissionsCommand" ; import { DescribeUserCommandInput , DescribeUserCommandOutput } from "../commands/DescribeUserCommand" ; import { GenerateEmbedUrlForAnonymousUserCommandInput , GenerateEmbedUrlForAnonymousUserCommandOutput , } from "../commands/GenerateEmbedUrlForAnonymousUserCommand" ; import { GenerateEmbedUrlForRegisteredUserCommandInput , GenerateEmbedUrlForRegisteredUserCommandOutput , } from "../commands/GenerateEmbedUrlForRegisteredUserCommand" ; import { GetDashboardEmbedUrlCommandInput , GetDashboardEmbedUrlCommandOutput , } from "../commands/GetDashboardEmbedUrlCommand" ; import { GetSessionEmbedUrlCommandInput , GetSessionEmbedUrlCommandOutput } from "../commands/GetSessionEmbedUrlCommand" ; import { ListAnalysesCommandInput , ListAnalysesCommandOutput } from "../commands/ListAnalysesCommand" ; import { ListDashboardsCommandInput , ListDashboardsCommandOutput } from "../commands/ListDashboardsCommand" ; import { ListDashboardVersionsCommandInput , ListDashboardVersionsCommandOutput , } from "../commands/ListDashboardVersionsCommand" ; import { ListDataSetsCommandInput , ListDataSetsCommandOutput } from "../commands/ListDataSetsCommand" ; import { ListDataSourcesCommandInput , ListDataSourcesCommandOutput } from "../commands/ListDataSourcesCommand" ; import { ListFolderMembersCommandInput , ListFolderMembersCommandOutput } from "../commands/ListFolderMembersCommand" ; import { ListFoldersCommandInput , ListFoldersCommandOutput } from "../commands/ListFoldersCommand" ; import { ListGroupMembershipsCommandInput , ListGroupMembershipsCommandOutput , } from "../commands/ListGroupMembershipsCommand" ; import { ListGroupsCommandInput , ListGroupsCommandOutput } from "../commands/ListGroupsCommand" ; import { ListIAMPolicyAssignmentsCommandInput , ListIAMPolicyAssignmentsCommandOutput , } from "../commands/ListIAMPolicyAssignmentsCommand" ; import { ListIAMPolicyAssignmentsForUserCommandInput , ListIAMPolicyAssignmentsForUserCommandOutput , } from "../commands/ListIAMPolicyAssignmentsForUserCommand" ; import { ListIngestionsCommandInput , ListIngestionsCommandOutput } from "../commands/ListIngestionsCommand" ; import { ListNamespacesCommandInput , ListNamespacesCommandOutput } from "../commands/ListNamespacesCommand" ; import { ListTagsForResourceCommandInput , ListTagsForResourceCommandOutput , } from "../commands/ListTagsForResourceCommand" ; import { ListTemplateAliasesCommandInput , ListTemplateAliasesCommandOutput , } from "../commands/ListTemplateAliasesCommand" ; import { ListTemplatesCommandInput , ListTemplatesCommandOutput } from "../commands/ListTemplatesCommand" ; import { ListTemplateVersionsCommandInput , ListTemplateVersionsCommandOutput , } from "../commands/ListTemplateVersionsCommand" ; import { ListThemeAliasesCommandInput , ListThemeAliasesCommandOutput } from "../commands/ListThemeAliasesCommand" ; import { ListThemesCommandInput , ListThemesCommandOutput } from "../commands/ListThemesCommand" ; import { ListThemeVersionsCommandInput , ListThemeVersionsCommandOutput } from "../commands/ListThemeVersionsCommand" ; import { ListUserGroupsCommandInput , ListUserGroupsCommandOutput } from "../commands/ListUserGroupsCommand" ; import { ListUsersCommandInput , ListUsersCommandOutput } from "../commands/ListUsersCommand" ; import { RegisterUserCommandInput , RegisterUserCommandOutput } from "../commands/RegisterUserCommand" ; import { RestoreAnalysisCommandInput , RestoreAnalysisCommandOutput } from "../commands/RestoreAnalysisCommand" ; import { SearchAnalysesCommandInput , SearchAnalysesCommandOutput } from "../commands/SearchAnalysesCommand" ; import { SearchDashboardsCommandInput , SearchDashboardsCommandOutput } from "../commands/SearchDashboardsCommand" ; import { SearchFoldersCommandInput , SearchFoldersCommandOutput } from "../commands/SearchFoldersCommand" ; import { TagResourceCommandInput , TagResourceCommandOutput } from "../commands/TagResourceCommand" ; import { UntagResourceCommandInput , UntagResourceCommandOutput } from "../commands/UntagResourceCommand" ; import { UpdateAccountCustomizationCommandInput , UpdateAccountCustomizationCommandOutput , } from "../commands/UpdateAccountCustomizationCommand" ; import { UpdateAccountSettingsCommandInput , UpdateAccountSettingsCommandOutput , } from "../commands/UpdateAccountSettingsCommand" ; import { UpdateAnalysisCommandInput , UpdateAnalysisCommandOutput } from "../commands/UpdateAnalysisCommand" ; import { UpdateAnalysisPermissionsCommandInput , UpdateAnalysisPermissionsCommandOutput , } from "../commands/UpdateAnalysisPermissionsCommand" ; import { UpdateDashboardCommandInput , UpdateDashboardCommandOutput } from "../commands/UpdateDashboardCommand" ; import { UpdateDashboardPermissionsCommandInput , UpdateDashboardPermissionsCommandOutput , } from "../commands/UpdateDashboardPermissionsCommand" ; import { UpdateDashboardPublishedVersionCommandInput , UpdateDashboardPublishedVersionCommandOutput , } from "../commands/UpdateDashboardPublishedVersionCommand" ; import { UpdateDataSetCommandInput , UpdateDataSetCommandOutput } from "../commands/UpdateDataSetCommand" ; import { UpdateDataSetPermissionsCommandInput , UpdateDataSetPermissionsCommandOutput , } from "../commands/UpdateDataSetPermissionsCommand" ; import { UpdateDataSourceCommandInput , UpdateDataSourceCommandOutput } from "../commands/UpdateDataSourceCommand" ; import { UpdateDataSourcePermissionsCommandInput , UpdateDataSourcePermissionsCommandOutput , } from "../commands/UpdateDataSourcePermissionsCommand" ; import { UpdateFolderCommandInput , UpdateFolderCommandOutput } from "../commands/UpdateFolderCommand" ; import { UpdateFolderPermissionsCommandInput , UpdateFolderPermissionsCommandOutput , } from "../commands/UpdateFolderPermissionsCommand" ; import { UpdateGroupCommandInput , UpdateGroupCommandOutput } from "../commands/UpdateGroupCommand" ; import { UpdateIAMPolicyAssignmentCommandInput , UpdateIAMPolicyAssignmentCommandOutput , } from "../commands/UpdateIAMPolicyAssignmentCommand" ; import { UpdateIpRestrictionCommandInput , UpdateIpRestrictionCommandOutput , } from "../commands/UpdateIpRestrictionCommand" ; import { UpdateTemplateAliasCommandInput , UpdateTemplateAliasCommandOutput , } from "../commands/UpdateTemplateAliasCommand" ; import { UpdateTemplateCommandInput , UpdateTemplateCommandOutput } from "../commands/UpdateTemplateCommand" ; import { UpdateTemplatePermissionsCommandInput , UpdateTemplatePermissionsCommandOutput , } from "../commands/UpdateTemplatePermissionsCommand" ; import { UpdateThemeAliasCommandInput , UpdateThemeAliasCommandOutput } from "../commands/UpdateThemeAliasCommand" ; import { UpdateThemeCommandInput , UpdateThemeCommandOutput } from "../commands/UpdateThemeCommand" ; import { UpdateThemePermissionsCommandInput , UpdateThemePermissionsCommandOutput , } from "../commands/UpdateThemePermissionsCommand" ; import { UpdateUserCommandInput , UpdateUserCommandOutput } from "../commands/UpdateUserCommand" ; import { _Parameters , AccessDeniedException , AccountCustomization , AccountSettings , ActiveIAMPolicyAssignment , AdHocFilteringOption , AmazonElasticsearchParameters , AmazonOpenSearchParameters , Analysis , AnalysisError , AnalysisSearchFilter , AnalysisSourceEntity , AnalysisSourceTemplate , AnalysisSummary , AnonymousUserDashboardEmbeddingConfiguration , AnonymousUserEmbeddingExperienceConfiguration , AthenaParameters , AuroraParameters , AuroraPostgreSqlParameters , AwsIotAnalyticsParameters , BorderStyle , CalculatedColumn , CastColumnTypeOperation , ColumnDescription , ColumnGroup , ColumnGroupColumnSchema , ColumnGroupSchema , ColumnLevelPermissionRule , ColumnSchema , ColumnTag , ColumnTagName , ConcurrentUpdatingException , ConflictException , CreateColumnsOperation , CredentialPair , CustomSql , Dashboard , DashboardError , DashboardPublishOptions , DashboardSearchFilter , DashboardSourceEntity , DashboardSourceTemplate , DashboardSummary , DashboardVersion , DashboardVersionSummary , DataColorPalette , DataSet , DataSetConfiguration , DataSetReference , DataSetSchema , DataSetSummary , DataSetUsageConfiguration , DataSource , DataSourceCredentials , DataSourceErrorInfo , DataSourceParameters , DateTimeParameter , DecimalParameter , ErrorInfo , ExasolParameters , ExportToCSVOption , FieldFolder , FilterOperation , Folder , FolderMember , GeoSpatialColumnGroup , Group , GroupMember , GutterStyle , IAMPolicyAssignment , Ingestion , InputColumn , IntegerParameter , InternalFailureException , InvalidNextTokenException , InvalidParameterValueException , JiraParameters , JoinInstruction , JoinKeyProperties , LimitExceededException , LinkSharingConfiguration , LogicalTable , LogicalTableSource , ManifestFileLocation , MarginStyle , MariaDbParameters , MySqlParameters , NamespaceError , NamespaceInfoV2 , OracleParameters , OutputColumn , PhysicalTable , PostgreSqlParameters , PreconditionNotMetException , PrestoParameters , ProjectOperation , QueueInfo , RdsParameters , RedshiftParameters , RelationalTable , RenameColumnOperation , ResourceExistsException , ResourceNotFoundException , ResourcePermission , ResourceUnavailableException , RowInfo , RowLevelPermissionDataSet , RowLevelPermissionTagConfiguration , RowLevelPermissionTagRule , S3Parameters , S3Source , ServiceNowParameters , Sheet , SheetControlsOption , SheetStyle , SnowflakeParameters , SparkParameters , SqlServerParameters , SslProperties , StringParameter , Tag , TagColumnOperation , Template , TemplateAlias , TemplateError , TemplateSourceAnalysis , TemplateSourceEntity , TemplateSourceTemplate , TemplateVersion , TeradataParameters , Theme , ThemeAlias , ThemeConfiguration , ThemeError , ThemeVersion , ThrottlingException , TileLayoutStyle , TileStyle , TransformOperation , TwitterParameters , UIColorPalette , UnsupportedUserEditionException , UntagColumnOperation , UploadSettings , VpcConnectionProperties , } from "../models/models_0" ; import { DomainNotWhitelistedException , FolderSearchFilter , FolderSummary , IAMPolicyAssignmentSummary , IdentityTypeNotSupportedException , MemberIdArnPair , QuickSightUserNotFoundException , RegisteredUserDashboardEmbeddingConfiguration , RegisteredUserEmbeddingExperienceConfiguration , RegisteredUserQSearchBarEmbeddingConfiguration , RegisteredUserQuickSightConsoleEmbeddingConfiguration , SessionLifetimeInMinutesInvalidException , SessionTag , TemplateSummary , TemplateVersionSummary , ThemeSummary , ThemeVersionSummary , UnsupportedPricingPlanException , User , } from "../models/models_1" ; export const serializeAws_restJson1CancelIngestionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } if ( input . IngestionId !== undefined ) { const labelValue = input . IngestionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: IngestionId." ) ; } resolvedPath = resolvedPath . replace ( "{IngestionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: IngestionId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateAccountCustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/customizations" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . Namespace !== undefined && { namespace : input . Namespace } ) , } ; let body ; body = JSON . stringify ( { ... ( input . AccountCustomization !== undefined && input . AccountCustomization !== null && { AccountCustomization : serializeAws_restJson1AccountCustomization ( input . AccountCustomization , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1CreateAnalysisCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : serializeAws_restJson1_Parameters ( input . Parameters , context ) } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1AnalysisSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , ... ( input . ThemeArn !== undefined && input . ThemeArn !== null && { ThemeArn : input . ThemeArn } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateDashboardCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } let body ; body = JSON . stringify ( { ... ( input . DashboardPublishOptions !== undefined && input . DashboardPublishOptions !== null && { DashboardPublishOptions : serializeAws_restJson1DashboardPublishOptions ( input . DashboardPublishOptions , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : serializeAws_restJson1_Parameters ( input . Parameters , context ) } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1DashboardSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , ... ( input . ThemeArn !== undefined && input . ThemeArn !== null && { ThemeArn : input . ThemeArn } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateDataSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . ColumnGroups !== undefined && input . ColumnGroups !== null && { ColumnGroups : serializeAws_restJson1ColumnGroupList ( input . ColumnGroups , context ) , } ) , ... ( input . ColumnLevelPermissionRules !== undefined && input . ColumnLevelPermissionRules !== null && { ColumnLevelPermissionRules : serializeAws_restJson1ColumnLevelPermissionRuleList ( input . ColumnLevelPermissionRules , context ) , } ) , ... ( input . DataSetId !== undefined && input . DataSetId !== null && { DataSetId : input . DataSetId } ) , ... ( input . DataSetUsageConfiguration !== undefined && input . DataSetUsageConfiguration !== null && { DataSetUsageConfiguration : serializeAws_restJson1DataSetUsageConfiguration ( input . DataSetUsageConfiguration , context ) , } ) , ... ( input . FieldFolders !== undefined && input . FieldFolders !== null && { FieldFolders : serializeAws_restJson1FieldFolderMap ( input . FieldFolders , context ) , } ) , ... ( input . ImportMode !== undefined && input . ImportMode !== null && { ImportMode : input . ImportMode } ) , ... ( input . LogicalTableMap !== undefined && input . LogicalTableMap !== null && { LogicalTableMap : serializeAws_restJson1LogicalTableMap ( input . LogicalTableMap , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . PhysicalTableMap !== undefined && input . PhysicalTableMap !== null && { PhysicalTableMap : serializeAws_restJson1PhysicalTableMap ( input . PhysicalTableMap , context ) , } ) , ... ( input . RowLevelPermissionDataSet !== undefined && input . RowLevelPermissionDataSet !== null && { RowLevelPermissionDataSet : serializeAws_restJson1RowLevelPermissionDataSet ( input . RowLevelPermissionDataSet , context ) , } ) , ... ( input . RowLevelPermissionTagConfiguration !== undefined && input . RowLevelPermissionTagConfiguration !== null && { RowLevelPermissionTagConfiguration : serializeAws_restJson1RowLevelPermissionTagConfiguration ( input . RowLevelPermissionTagConfiguration , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateDataSourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Credentials !== undefined && input . Credentials !== null && { Credentials : serializeAws_restJson1DataSourceCredentials ( input . Credentials , context ) , } ) , ... ( input . DataSourceId !== undefined && input . DataSourceId !== null && { DataSourceId : input . DataSourceId } ) , ... ( input . DataSourceParameters !== undefined && input . DataSourceParameters !== null && { DataSourceParameters : serializeAws_restJson1DataSourceParameters ( input . DataSourceParameters , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . SslProperties !== undefined && input . SslProperties !== null && { SslProperties : serializeAws_restJson1SslProperties ( input . SslProperties , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , ... ( input . VpcConnectionProperties !== undefined && input . VpcConnectionProperties !== null && { VpcConnectionProperties : serializeAws_restJson1VpcConnectionProperties ( input . VpcConnectionProperties , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateFolderCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; body = JSON . stringify ( { ... ( input . FolderType !== undefined && input . FolderType !== null && { FolderType : input . FolderType } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . ParentFolderArn !== undefined && input . ParentFolderArn !== null && { ParentFolderArn : input . ParentFolderArn } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateFolderMembershipCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/members/{MemberType}/{MemberId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } if ( input . MemberId !== undefined ) { const labelValue = input . MemberId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberId." ) ; } resolvedPath = resolvedPath . replace ( "{MemberId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberId." ) ; } if ( input . MemberType !== undefined ) { const labelValue = input . MemberType ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberType." ) ; } resolvedPath = resolvedPath . replace ( "{MemberType}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberType." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , ... ( input . GroupName !== undefined && input . GroupName !== null && { GroupName : input . GroupName } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateGroupMembershipCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}" ; if ( input . MemberName !== undefined ) { const labelValue = input . MemberName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberName." ) ; } resolvedPath = resolvedPath . replace ( "{MemberName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberName." ) ; } if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateIAMPolicyAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . AssignmentName !== undefined && input . AssignmentName !== null && { AssignmentName : input . AssignmentName } ) , ... ( input . AssignmentStatus !== undefined && input . AssignmentStatus !== null && { AssignmentStatus : input . AssignmentStatus } ) , ... ( input . Identities !== undefined && input . Identities !== null && { Identities : serializeAws_restJson1IdentityMap ( input . Identities , context ) } ) , ... ( input . PolicyArn !== undefined && input . PolicyArn !== null && { PolicyArn : input . PolicyArn } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateIngestionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}" ; if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } if ( input . IngestionId !== undefined ) { const labelValue = input . IngestionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: IngestionId." ) ; } resolvedPath = resolvedPath . replace ( "{IngestionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: IngestionId." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . IngestionType !== undefined && input . IngestionType !== null && { IngestionType : input . IngestionType } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateNamespaceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . IdentityStore !== undefined && input . IdentityStore !== null && { IdentityStore : input . IdentityStore } ) , ... ( input . Namespace !== undefined && input . Namespace !== null && { Namespace : input . Namespace } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1TemplateSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateTemplateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; body = JSON . stringify ( { ... ( input . TemplateVersionNumber !== undefined && input . TemplateVersionNumber !== null && { TemplateVersionNumber : input . TemplateVersionNumber } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateThemeCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } let body ; body = JSON . stringify ( { ... ( input . BaseThemeId !== undefined && input . BaseThemeId !== null && { BaseThemeId : input . BaseThemeId } ) , ... ( input . Configuration !== undefined && input . Configuration !== null && { Configuration : serializeAws_restJson1ThemeConfiguration ( input . Configuration , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Permissions !== undefined && input . Permissions !== null && { Permissions : serializeAws_restJson1ResourcePermissionList ( input . Permissions , context ) , } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1CreateThemeAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; body = JSON . stringify ( { ... ( input . ThemeVersionNumber !== undefined && input . ThemeVersionNumber !== null && { ThemeVersionNumber : input . ThemeVersionNumber } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteAccountCustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/customizations" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . Namespace !== undefined && { namespace : input . Namespace } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DeleteAnalysisCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } const query = { ... ( input . RecoveryWindowInDays !== undefined && { "recovery-window-in-days" : input . RecoveryWindowInDays . toString ( ) , } ) , ... ( input . ForceDeleteWithoutRecovery !== undefined && { "force-delete-without-recovery" : input . ForceDeleteWithoutRecovery . toString ( ) , } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DeleteDashboardCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DeleteDataSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteDataSourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources/{DataSourceId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSourceId !== undefined ) { const labelValue = input . DataSourceId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSourceId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSourceId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSourceId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteFolderCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteFolderMembershipCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/members/{MemberType}/{MemberId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } if ( input . MemberId !== undefined ) { const labelValue = input . MemberId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberId." ) ; } resolvedPath = resolvedPath . replace ( "{MemberId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberId." ) ; } if ( input . MemberType !== undefined ) { const labelValue = input . MemberType ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberType." ) ; } resolvedPath = resolvedPath . replace ( "{MemberType}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberType." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}" ; if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteGroupMembershipCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members/{MemberName}" ; if ( input . MemberName !== undefined ) { const labelValue = input . MemberName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: MemberName." ) ; } resolvedPath = resolvedPath . replace ( "{MemberName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: MemberName." ) ; } if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteIAMPolicyAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespace/{Namespace}/iam-policy-assignments/{AssignmentName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AssignmentName !== undefined ) { const labelValue = input . AssignmentName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AssignmentName." ) ; } resolvedPath = resolvedPath . replace ( "{AssignmentName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AssignmentName." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteNamespaceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DeleteTemplateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteThemeCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DeleteThemeAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}" ; if ( input . UserName !== undefined ) { const labelValue = input . UserName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: UserName." ) ; } resolvedPath = resolvedPath . replace ( "{UserName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: UserName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DeleteUserByPrincipalIdCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/user-principals/{PrincipalId}" ; if ( input . PrincipalId !== undefined ) { const labelValue = input . PrincipalId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: PrincipalId." ) ; } resolvedPath = resolvedPath . replace ( "{PrincipalId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: PrincipalId." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeAccountCustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/customizations" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . Namespace !== undefined && { namespace : input . Namespace } ) , ... ( input . Resolved !== undefined && { resolved : input . Resolved . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DescribeAccountSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/settings" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeAnalysisCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeAnalysisPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDashboardCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , ... ( input . AliasName !== undefined && { "alias-name" : input . AliasName } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DescribeDashboardPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDataSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDataSetPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDataSourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources/{DataSourceId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSourceId !== undefined ) { const labelValue = input . DataSourceId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSourceId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSourceId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSourceId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeDataSourcePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSourceId !== undefined ) { const labelValue = input . DataSourceId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSourceId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSourceId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSourceId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeFolderCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeFolderPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeFolderResolvedPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/resolved-permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}" ; if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeIAMPolicyAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AssignmentName !== undefined ) { const labelValue = input . AssignmentName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AssignmentName." ) ; } resolvedPath = resolvedPath . replace ( "{AssignmentName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AssignmentName." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeIngestionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions/{IngestionId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } if ( input . IngestionId !== undefined ) { const labelValue = input . IngestionId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: IngestionId." ) ; } resolvedPath = resolvedPath . replace ( "{IngestionId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: IngestionId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeIpRestrictionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/ip-restriction" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeNamespaceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , ... ( input . AliasName !== undefined && { "alias-name" : input . AliasName } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DescribeTemplateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeTemplatePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeThemeCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } const query = { ... ( input . VersionNumber !== undefined && { "version-number" : input . VersionNumber . toString ( ) } ) , ... ( input . AliasName !== undefined && { "alias-name" : input . AliasName } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1DescribeThemeAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeThemePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1DescribeUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}" ; if ( input . UserName !== undefined ) { const labelValue = input . UserName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: UserName." ) ; } resolvedPath = resolvedPath . replace ( "{UserName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: UserName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/embed-url/anonymous-user" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . AuthorizedResourceArns !== undefined && input . AuthorizedResourceArns !== null && { AuthorizedResourceArns : serializeAws_restJson1ArnList ( input . AuthorizedResourceArns , context ) , } ) , ... ( input . ExperienceConfiguration !== undefined && input . ExperienceConfiguration !== null && { ExperienceConfiguration : serializeAws_restJson1AnonymousUserEmbeddingExperienceConfiguration ( input . ExperienceConfiguration , context ) , } ) , ... ( input . Namespace !== undefined && input . Namespace !== null && { Namespace : input . Namespace } ) , ... ( input . SessionLifetimeInMinutes !== undefined && input . SessionLifetimeInMinutes !== null && { SessionLifetimeInMinutes : input . SessionLifetimeInMinutes } ) , ... ( input . SessionTags !== undefined && input . SessionTags !== null && { SessionTags : serializeAws_restJson1SessionTagList ( input . SessionTags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/embed-url/registered-user" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . ExperienceConfiguration !== undefined && input . ExperienceConfiguration !== null && { ExperienceConfiguration : serializeAws_restJson1RegisteredUserEmbeddingExperienceConfiguration ( input . ExperienceConfiguration , context ) , } ) , ... ( input . SessionLifetimeInMinutes !== undefined && input . SessionLifetimeInMinutes !== null && { SessionLifetimeInMinutes : input . SessionLifetimeInMinutes } ) , ... ( input . UserArn !== undefined && input . UserArn !== null && { UserArn : input . UserArn } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1GetDashboardEmbedUrlCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}/embed-url" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } const query = { ... ( input . IdentityType !== undefined && { "creds-type" : input . IdentityType } ) , ... ( input . SessionLifetimeInMinutes !== undefined && { "session-lifetime" : input . SessionLifetimeInMinutes . toString ( ) , } ) , ... ( input . UndoRedoDisabled !== undefined && { "undo-redo-disabled" : input . UndoRedoDisabled . toString ( ) } ) , ... ( input . ResetDisabled !== undefined && { "reset-disabled" : input . ResetDisabled . toString ( ) } ) , ... ( input . StatePersistenceEnabled !== undefined && { "state-persistence-enabled" : input . StatePersistenceEnabled . toString ( ) , } ) , ... ( input . UserArn !== undefined && { "user-arn" : input . UserArn } ) , ... ( input . Namespace !== undefined && { namespace : input . Namespace } ) , ... ( input . AdditionalDashboardIds !== undefined && { "additional-dashboard-ids" : ( input . AdditionalDashboardIds || [ ] ) . map ( ( _entry ) => _entry as any ) , } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1GetSessionEmbedUrlCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/session-embed-url" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . EntryPoint !== undefined && { "entry-point" : input . EntryPoint } ) , ... ( input . SessionLifetimeInMinutes !== undefined && { "session-lifetime" : input . SessionLifetimeInMinutes . toString ( ) , } ) , ... ( input . UserArn !== undefined && { "user-arn" : input . UserArn } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListAnalysesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListDashboardsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListDashboardVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListDataSetsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListDataSourcesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListFolderMembersCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/members" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListFoldersCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListGroupMembershipsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}/members" ; if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListIAMPolicyAssignmentsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; body = JSON . stringify ( { ... ( input . AssignmentStatus !== undefined && input . AssignmentStatus !== null && { AssignmentStatus : input . AssignmentStatus } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListIAMPolicyAssignmentsForUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/iam-policy-assignments" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . UserName !== undefined ) { const labelValue = input . UserName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: UserName." ) ; } resolvedPath = resolvedPath . replace ( "{UserName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: UserName." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListIngestionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/ingestions" ; if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListNamespacesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListTagsForResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/resources/{ResourceArn}/tags" ; if ( input . ResourceArn !== undefined ) { const labelValue = input . ResourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ResourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{ResourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ResourceArn." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1ListTemplateAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-result" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListTemplatesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-result" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListTemplateVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/versions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListThemeAliasesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-result" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListThemesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , ... ( input . Type !== undefined && { type : input . Type } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListThemeVersionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/versions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListUserGroupsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}/groups" ; if ( input . UserName !== undefined ) { const labelValue = input . UserName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: UserName." ) ; } resolvedPath = resolvedPath . replace ( "{UserName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: UserName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1ListUsersCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } const query = { ... ( input . NextToken !== undefined && { "next-token" : input . NextToken } ) , ... ( input . MaxResults !== undefined && { "max-results" : input . MaxResults . toString ( ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "GET" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1RegisterUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . CustomFederationProviderUrl !== undefined && input . CustomFederationProviderUrl !== null && { CustomFederationProviderUrl : input . CustomFederationProviderUrl } ) , ... ( input . CustomPermissionsName !== undefined && input . CustomPermissionsName !== null && { CustomPermissionsName : input . CustomPermissionsName } ) , ... ( input . Email !== undefined && input . Email !== null && { Email : input . Email } ) , ... ( input . ExternalLoginFederationProviderType !== undefined && input . ExternalLoginFederationProviderType !== null && { ExternalLoginFederationProviderType : input . ExternalLoginFederationProviderType , } ) , ... ( input . ExternalLoginId !== undefined && input . ExternalLoginId !== null && { ExternalLoginId : input . ExternalLoginId } ) , ... ( input . IamArn !== undefined && input . IamArn !== null && { IamArn : input . IamArn } ) , ... ( input . IdentityType !== undefined && input . IdentityType !== null && { IdentityType : input . IdentityType } ) , ... ( input . SessionName !== undefined && input . SessionName !== null && { SessionName : input . SessionName } ) , ... ( input . UserName !== undefined && input . UserName !== null && { UserName : input . UserName } ) , ... ( input . UserRole !== undefined && input . UserRole !== null && { UserRole : input . UserRole } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1RestoreAnalysisCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/restore/analyses/{AnalysisId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1SearchAnalysesCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/search/analyses" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_restJson1AnalysisSearchFilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1SearchDashboardsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/search/dashboards" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_restJson1DashboardSearchFilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1SearchFoldersCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/search/folders" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Filters !== undefined && input . Filters !== null && { Filters : serializeAws_restJson1FolderSearchFilterList ( input . Filters , context ) } ) , ... ( input . MaxResults !== undefined && input . MaxResults !== null && { MaxResults : input . MaxResults } ) , ... ( input . NextToken !== undefined && input . NextToken !== null && { NextToken : input . NextToken } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1TagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/resources/{ResourceArn}/tags" ; if ( input . ResourceArn !== undefined ) { const labelValue = input . ResourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ResourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{ResourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ResourceArn." ) ; } let body ; body = JSON . stringify ( { ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1TagList ( input . Tags , context ) } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UntagResourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/resources/{ResourceArn}/tags" ; if ( input . ResourceArn !== undefined ) { const labelValue = input . ResourceArn ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ResourceArn." ) ; } resolvedPath = resolvedPath . replace ( "{ResourceArn}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ResourceArn." ) ; } const query = { ... ( input . TagKeys !== undefined && { keys : ( input . TagKeys || [ ] ) . map ( ( _entry ) => _entry as any ) } ) , } ; let body ; return new __HttpRequest ( { protocol , hostname , port , method : "DELETE" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1UpdateAccountCustomizationCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/customizations" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } const query = { ... ( input . Namespace !== undefined && { namespace : input . Namespace } ) , } ; let body ; body = JSON . stringify ( { ... ( input . AccountCustomization !== undefined && input . AccountCustomization !== null && { AccountCustomization : serializeAws_restJson1AccountCustomization ( input . AccountCustomization , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , query , body , } ) ; } ; export const serializeAws_restJson1UpdateAccountSettingsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/settings" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . DefaultNamespace !== undefined && input . DefaultNamespace !== null && { DefaultNamespace : input . DefaultNamespace } ) , ... ( input . NotificationEmail !== undefined && input . NotificationEmail !== null && { NotificationEmail : input . NotificationEmail } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateAnalysisCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : serializeAws_restJson1_Parameters ( input . Parameters , context ) } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1AnalysisSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . ThemeArn !== undefined && input . ThemeArn !== null && { ThemeArn : input . ThemeArn } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateAnalysisPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/analyses/{AnalysisId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AnalysisId !== undefined ) { const labelValue = input . AnalysisId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AnalysisId." ) ; } resolvedPath = resolvedPath . replace ( "{AnalysisId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AnalysisId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDashboardCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } let body ; body = JSON . stringify ( { ... ( input . DashboardPublishOptions !== undefined && input . DashboardPublishOptions !== null && { DashboardPublishOptions : serializeAws_restJson1DashboardPublishOptions ( input . DashboardPublishOptions , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Parameters !== undefined && input . Parameters !== null && { Parameters : serializeAws_restJson1_Parameters ( input . Parameters , context ) } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1DashboardSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . ThemeArn !== undefined && input . ThemeArn !== null && { ThemeArn : input . ThemeArn } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDashboardPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantLinkPermissions !== undefined && input . GrantLinkPermissions !== null && { GrantLinkPermissions : serializeAws_restJson1UpdateLinkPermissionList ( input . GrantLinkPermissions , context ) , } ) , ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokeLinkPermissions !== undefined && input . RevokeLinkPermissions !== null && { RevokeLinkPermissions : serializeAws_restJson1UpdateLinkPermissionList ( input . RevokeLinkPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDashboardPublishedVersionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/dashboards/{DashboardId}/versions/{VersionNumber}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DashboardId !== undefined ) { const labelValue = input . DashboardId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DashboardId." ) ; } resolvedPath = resolvedPath . replace ( "{DashboardId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DashboardId." ) ; } if ( input . VersionNumber !== undefined ) { const labelValue = input . VersionNumber . toString ( ) ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: VersionNumber." ) ; } resolvedPath = resolvedPath . replace ( "{VersionNumber}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: VersionNumber." ) ; } let body ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDataSetCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } let body ; body = JSON . stringify ( { ... ( input . ColumnGroups !== undefined && input . ColumnGroups !== null && { ColumnGroups : serializeAws_restJson1ColumnGroupList ( input . ColumnGroups , context ) , } ) , ... ( input . ColumnLevelPermissionRules !== undefined && input . ColumnLevelPermissionRules !== null && { ColumnLevelPermissionRules : serializeAws_restJson1ColumnLevelPermissionRuleList ( input . ColumnLevelPermissionRules , context ) , } ) , ... ( input . DataSetUsageConfiguration !== undefined && input . DataSetUsageConfiguration !== null && { DataSetUsageConfiguration : serializeAws_restJson1DataSetUsageConfiguration ( input . DataSetUsageConfiguration , context ) , } ) , ... ( input . FieldFolders !== undefined && input . FieldFolders !== null && { FieldFolders : serializeAws_restJson1FieldFolderMap ( input . FieldFolders , context ) , } ) , ... ( input . ImportMode !== undefined && input . ImportMode !== null && { ImportMode : input . ImportMode } ) , ... ( input . LogicalTableMap !== undefined && input . LogicalTableMap !== null && { LogicalTableMap : serializeAws_restJson1LogicalTableMap ( input . LogicalTableMap , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . PhysicalTableMap !== undefined && input . PhysicalTableMap !== null && { PhysicalTableMap : serializeAws_restJson1PhysicalTableMap ( input . PhysicalTableMap , context ) , } ) , ... ( input . RowLevelPermissionDataSet !== undefined && input . RowLevelPermissionDataSet !== null && { RowLevelPermissionDataSet : serializeAws_restJson1RowLevelPermissionDataSet ( input . RowLevelPermissionDataSet , context ) , } ) , ... ( input . RowLevelPermissionTagConfiguration !== undefined && input . RowLevelPermissionTagConfiguration !== null && { RowLevelPermissionTagConfiguration : serializeAws_restJson1RowLevelPermissionTagConfiguration ( input . RowLevelPermissionTagConfiguration , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDataSetPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sets/{DataSetId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSetId !== undefined ) { const labelValue = input . DataSetId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSetId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSetId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSetId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1ResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1ResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDataSourceCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources/{DataSourceId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSourceId !== undefined ) { const labelValue = input . DataSourceId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSourceId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSourceId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSourceId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Credentials !== undefined && input . Credentials !== null && { Credentials : serializeAws_restJson1DataSourceCredentials ( input . Credentials , context ) , } ) , ... ( input . DataSourceParameters !== undefined && input . DataSourceParameters !== null && { DataSourceParameters : serializeAws_restJson1DataSourceParameters ( input . DataSourceParameters , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SslProperties !== undefined && input . SslProperties !== null && { SslProperties : serializeAws_restJson1SslProperties ( input . SslProperties , context ) , } ) , ... ( input . VpcConnectionProperties !== undefined && input . VpcConnectionProperties !== null && { VpcConnectionProperties : serializeAws_restJson1VpcConnectionProperties ( input . VpcConnectionProperties , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateDataSourcePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/data-sources/{DataSourceId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . DataSourceId !== undefined ) { const labelValue = input . DataSourceId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: DataSourceId." ) ; } resolvedPath = resolvedPath . replace ( "{DataSourceId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: DataSourceId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1ResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1ResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateFolderCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateFolderPermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/folders/{FolderId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . FolderId !== undefined ) { const labelValue = input . FolderId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: FolderId." ) ; } resolvedPath = resolvedPath . replace ( "{FolderId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: FolderId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1ResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1ResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateGroupCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/groups/{GroupName}" ; if ( input . GroupName !== undefined ) { const labelValue = input . GroupName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: GroupName." ) ; } resolvedPath = resolvedPath . replace ( "{GroupName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: GroupName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . Description !== undefined && input . Description !== null && { Description : input . Description } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateIAMPolicyAssignmentCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/iam-policy-assignments/{AssignmentName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . AssignmentName !== undefined ) { const labelValue = input . AssignmentName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AssignmentName." ) ; } resolvedPath = resolvedPath . replace ( "{AssignmentName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AssignmentName." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . AssignmentStatus !== undefined && input . AssignmentStatus !== null && { AssignmentStatus : input . AssignmentStatus } ) , ... ( input . Identities !== undefined && input . Identities !== null && { Identities : serializeAws_restJson1IdentityMap ( input . Identities , context ) } ) , ... ( input . PolicyArn !== undefined && input . PolicyArn !== null && { PolicyArn : input . PolicyArn } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateIpRestrictionCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/ip-restriction" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Enabled !== undefined && input . Enabled !== null && { Enabled : input . Enabled } ) , ... ( input . IpRestrictionRuleMap !== undefined && input . IpRestrictionRuleMap !== null && { IpRestrictionRuleMap : serializeAws_restJson1IpRestrictionRuleMap ( input . IpRestrictionRuleMap , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "POST" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateTemplateCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } let body ; body = JSON . stringify ( { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SourceEntity !== undefined && input . SourceEntity !== null && { SourceEntity : serializeAws_restJson1TemplateSourceEntity ( input . SourceEntity , context ) , } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateTemplateAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; body = JSON . stringify ( { ... ( input . TemplateVersionNumber !== undefined && input . TemplateVersionNumber !== null && { TemplateVersionNumber : input . TemplateVersionNumber } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateTemplatePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/templates/{TemplateId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . TemplateId !== undefined ) { const labelValue = input . TemplateId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: TemplateId." ) ; } resolvedPath = resolvedPath . replace ( "{TemplateId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: TemplateId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateThemeCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } let body ; body = JSON . stringify ( { ... ( input . BaseThemeId !== undefined && input . BaseThemeId !== null && { BaseThemeId : input . BaseThemeId } ) , ... ( input . Configuration !== undefined && input . Configuration !== null && { Configuration : serializeAws_restJson1ThemeConfiguration ( input . Configuration , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . VersionDescription !== undefined && input . VersionDescription !== null && { VersionDescription : input . VersionDescription } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateThemeAliasCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/aliases/{AliasName}" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } if ( input . AliasName !== undefined ) { const labelValue = input . AliasName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AliasName." ) ; } resolvedPath = resolvedPath . replace ( "{AliasName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AliasName." ) ; } let body ; body = JSON . stringify ( { ... ( input . ThemeVersionNumber !== undefined && input . ThemeVersionNumber !== null && { ThemeVersionNumber : input . ThemeVersionNumber } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateThemePermissionsCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/themes/{ThemeId}/permissions" ; if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . ThemeId !== undefined ) { const labelValue = input . ThemeId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: ThemeId." ) ; } resolvedPath = resolvedPath . replace ( "{ThemeId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: ThemeId." ) ; } let body ; body = JSON . stringify ( { ... ( input . GrantPermissions !== undefined && input . GrantPermissions !== null && { GrantPermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . GrantPermissions , context ) , } ) , ... ( input . RevokePermissions !== undefined && input . RevokePermissions !== null && { RevokePermissions : serializeAws_restJson1UpdateResourcePermissionList ( input . RevokePermissions , context ) , } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const serializeAws_restJson1UpdateUserCommand = async ( input , context ) : Promise < __HttpRequest > => { const { hostname , protocol = "https" , port , path : basePath } = await context . endpoint ( ) ; const headers = { "content-type" : "application/json" , } ; let resolvedPath = `${ basePath ?. endsWith ( "/" ) ? basePath . slice ( 0 , - 1 ) : basePath || "" }` + "/accounts/{AwsAccountId}/namespaces/{Namespace}/users/{UserName}" ; if ( input . UserName !== undefined ) { const labelValue = input . UserName ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: UserName." ) ; } resolvedPath = resolvedPath . replace ( "{UserName}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: UserName." ) ; } if ( input . AwsAccountId !== undefined ) { const labelValue = input . AwsAccountId ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: AwsAccountId." ) ; } resolvedPath = resolvedPath . replace ( "{AwsAccountId}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: AwsAccountId." ) ; } if ( input . Namespace !== undefined ) { const labelValue = input . Namespace ; if ( labelValue . length <= 0 ) { throw new Error ( "Empty value provided for input HTTP label: Namespace." ) ; } resolvedPath = resolvedPath . replace ( "{Namespace}" , __extendedEncodeURIComponent ( labelValue ) ) ; } else { throw new Error ( "No value provided for input HTTP label: Namespace." ) ; } let body ; body = JSON . stringify ( { ... ( input . CustomFederationProviderUrl !== undefined && input . CustomFederationProviderUrl !== null && { CustomFederationProviderUrl : input . CustomFederationProviderUrl } ) , ... ( input . CustomPermissionsName !== undefined && input . CustomPermissionsName !== null && { CustomPermissionsName : input . CustomPermissionsName } ) , ... ( input . Email !== undefined && input . Email !== null && { Email : input . Email } ) , ... ( input . ExternalLoginFederationProviderType !== undefined && input . ExternalLoginFederationProviderType !== null && { ExternalLoginFederationProviderType : input . ExternalLoginFederationProviderType , } ) , ... ( input . ExternalLoginId !== undefined && input . ExternalLoginId !== null && { ExternalLoginId : input . ExternalLoginId } ) , ... ( input . Role !== undefined && input . Role !== null && { Role : input . Role } ) , ... ( input . UnapplyCustomPermissions !== undefined && input . UnapplyCustomPermissions !== null && { UnapplyCustomPermissions : input . UnapplyCustomPermissions } ) , } ) ; return new __HttpRequest ( { protocol , hostname , port , method : "PUT" , headers , path : resolvedPath , body , } ) ; } ; export const deserializeAws_restJson1CancelIngestionCommand = async ( output , context ) : Promise < CancelIngestionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CancelIngestionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , IngestionId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . IngestionId !== undefined && data . IngestionId !== null ) { contents . IngestionId = __expectString ( data . IngestionId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CancelIngestionCommandError = async ( output , context ) : Promise < CancelIngestionCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateAccountCustomizationCommand = async ( output , context ) : Promise < CreateAccountCustomizationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateAccountCustomizationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AccountCustomization : undefined , Arn : undefined , AwsAccountId : undefined , Namespace : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AccountCustomization !== undefined && data . AccountCustomization !== null ) { contents . AccountCustomization = deserializeAws_restJson1AccountCustomization ( data . AccountCustomization , context ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . AwsAccountId !== undefined && data . AwsAccountId !== null ) { contents . AwsAccountId = __expectString ( data . AwsAccountId ) ; } if ( data . Namespace !== undefined && data . Namespace !== null ) { contents . Namespace = __expectString ( data . Namespace ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateAccountCustomizationCommandError = async ( output , context ) : Promise < CreateAccountCustomizationCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateAnalysisCommand = async ( output , context ) : Promise < CreateAnalysisCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateAnalysisCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisId : undefined , Arn : undefined , CreationStatus : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateAnalysisCommandError = async ( output , context ) : Promise < CreateAnalysisCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateDashboardCommand = async ( output , context ) : Promise < CreateDashboardCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateDashboardCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , DashboardId : undefined , RequestId : undefined , Status : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateDashboardCommandError = async ( output , context ) : Promise < CreateDashboardCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateDataSetCommand = async ( output , context ) : Promise < CreateDataSetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateDataSetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DataSetId : undefined , IngestionArn : undefined , IngestionId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DataSetId !== undefined && data . DataSetId !== null ) { contents . DataSetId = __expectString ( data . DataSetId ) ; } if ( data . IngestionArn !== undefined && data . IngestionArn !== null ) { contents . IngestionArn = __expectString ( data . IngestionArn ) ; } if ( data . IngestionId !== undefined && data . IngestionId !== null ) { contents . IngestionId = __expectString ( data . IngestionId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateDataSetCommandError = async ( output , context ) : Promise < CreateDataSetCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateDataSourceCommand = async ( output , context ) : Promise < CreateDataSourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateDataSourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , DataSourceId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . DataSourceId !== undefined && data . DataSourceId !== null ) { contents . DataSourceId = __expectString ( data . DataSourceId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateDataSourceCommandError = async ( output , context ) : Promise < CreateDataSourceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateFolderCommand = async ( output , context ) : Promise < CreateFolderCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateFolderCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateFolderCommandError = async ( output , context ) : Promise < CreateFolderCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateFolderMembershipCommand = async ( output , context ) : Promise < CreateFolderMembershipCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateFolderMembershipCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FolderMember : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . FolderMember !== undefined && data . FolderMember !== null ) { contents . FolderMember = deserializeAws_restJson1FolderMember ( data . FolderMember , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Status !== undefined && data . Status !== null ) { contents . Status = __expectInt32 ( data . Status ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateFolderMembershipCommandError = async ( output , context ) : Promise < CreateFolderMembershipCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateGroupCommand = async ( output , context ) : Promise < CreateGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Group : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Group !== undefined && data . Group !== null ) { contents . Group = deserializeAws_restJson1Group ( data . Group , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateGroupCommandError = async ( output , context ) : Promise < CreateGroupCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateGroupMembershipCommand = async ( output , context ) : Promise < CreateGroupMembershipCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateGroupMembershipCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , GroupMember : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . GroupMember !== undefined && data . GroupMember !== null ) { contents . GroupMember = deserializeAws_restJson1GroupMember ( data . GroupMember , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateGroupMembershipCommandError = async ( output , context ) : Promise < CreateGroupMembershipCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateIAMPolicyAssignmentCommand = async ( output , context ) : Promise < CreateIAMPolicyAssignmentCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateIAMPolicyAssignmentCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AssignmentId : undefined , AssignmentName : undefined , AssignmentStatus : undefined , Identities : undefined , PolicyArn : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AssignmentId !== undefined && data . AssignmentId !== null ) { contents . AssignmentId = __expectString ( data . AssignmentId ) ; } if ( data . AssignmentName !== undefined && data . AssignmentName !== null ) { contents . AssignmentName = __expectString ( data . AssignmentName ) ; } if ( data . AssignmentStatus !== undefined && data . AssignmentStatus !== null ) { contents . AssignmentStatus = __expectString ( data . AssignmentStatus ) ; } if ( data . Identities !== undefined && data . Identities !== null ) { contents . Identities = deserializeAws_restJson1IdentityMap ( data . Identities , context ) ; } if ( data . PolicyArn !== undefined && data . PolicyArn !== null ) { contents . PolicyArn = __expectString ( data . PolicyArn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateIAMPolicyAssignmentCommandError = async ( output , context ) : Promise < CreateIAMPolicyAssignmentCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConcurrentUpdatingException" : case "com.amazonaws.quicksight#ConcurrentUpdatingException" : response = { ... ( await deserializeAws_restJson1ConcurrentUpdatingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateIngestionCommand = async ( output , context ) : Promise < CreateIngestionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateIngestionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , IngestionId : undefined , IngestionStatus : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . IngestionId !== undefined && data . IngestionId !== null ) { contents . IngestionId = __expectString ( data . IngestionId ) ; } if ( data . IngestionStatus !== undefined && data . IngestionStatus !== null ) { contents . IngestionStatus = __expectString ( data . IngestionStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateIngestionCommandError = async ( output , context ) : Promise < CreateIngestionCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateNamespaceCommand = async ( output , context ) : Promise < CreateNamespaceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateNamespaceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CapacityRegion : undefined , CreationStatus : undefined , IdentityStore : undefined , Name : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CapacityRegion !== undefined && data . CapacityRegion !== null ) { contents . CapacityRegion = __expectString ( data . CapacityRegion ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . IdentityStore !== undefined && data . IdentityStore !== null ) { contents . IdentityStore = __expectString ( data . IdentityStore ) ; } if ( data . Name !== undefined && data . Name !== null ) { contents . Name = __expectString ( data . Name ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateNamespaceCommandError = async ( output , context ) : Promise < CreateNamespaceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1CreateTemplateCommand = async ( output , context ) : Promise < CreateTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , RequestId : undefined , Status : undefined , TemplateId : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateTemplateCommandError = async ( output , context ) : Promise < CreateTemplateCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateTemplateAliasCommand = async ( output , context ) : Promise < CreateTemplateAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateTemplateAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , TemplateAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateAlias !== undefined && data . TemplateAlias !== null ) { contents . TemplateAlias = deserializeAws_restJson1TemplateAlias ( data . TemplateAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateTemplateAliasCommandError = async ( output , context ) : Promise < CreateTemplateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateThemeCommand = async ( output , context ) : Promise < CreateThemeCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateThemeCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , RequestId : undefined , Status : undefined , ThemeId : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateThemeCommandError = async ( output , context ) : Promise < CreateThemeCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1CreateThemeAliasCommand = async ( output , context ) : Promise < CreateThemeAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1CreateThemeAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , ThemeAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeAlias !== undefined && data . ThemeAlias !== null ) { contents . ThemeAlias = deserializeAws_restJson1ThemeAlias ( data . ThemeAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1CreateThemeAliasCommandError = async ( output , context ) : Promise < CreateThemeAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteAccountCustomizationCommand = async ( output , context ) : Promise < DeleteAccountCustomizationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteAccountCustomizationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteAccountCustomizationCommandError = async ( output , context ) : Promise < DeleteAccountCustomizationCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteAnalysisCommand = async ( output , context ) : Promise < DeleteAnalysisCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteAnalysisCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisId : undefined , Arn : undefined , DeletionTime : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DeletionTime !== undefined && data . DeletionTime !== null ) { contents . DeletionTime = __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( data . DeletionTime ) ) ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteAnalysisCommandError = async ( output , context ) : Promise < DeleteAnalysisCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteDashboardCommand = async ( output , context ) : Promise < DeleteDashboardCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteDashboardCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DashboardId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteDashboardCommandError = async ( output , context ) : Promise < DeleteDashboardCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteDataSetCommand = async ( output , context ) : Promise < DeleteDataSetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteDataSetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DataSetId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DataSetId !== undefined && data . DataSetId !== null ) { contents . DataSetId = __expectString ( data . DataSetId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteDataSetCommandError = async ( output , context ) : Promise < DeleteDataSetCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteDataSourceCommand = async ( output , context ) : Promise < DeleteDataSourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteDataSourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DataSourceId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DataSourceId !== undefined && data . DataSourceId !== null ) { contents . DataSourceId = __expectString ( data . DataSourceId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteDataSourceCommandError = async ( output , context ) : Promise < DeleteDataSourceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteFolderCommand = async ( output , context ) : Promise < DeleteFolderCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteFolderCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteFolderCommandError = async ( output , context ) : Promise < DeleteFolderCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteFolderMembershipCommand = async ( output , context ) : Promise < DeleteFolderMembershipCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteFolderMembershipCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Status !== undefined && data . Status !== null ) { contents . Status = __expectInt32 ( data . Status ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteFolderMembershipCommandError = async ( output , context ) : Promise < DeleteFolderMembershipCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteGroupCommand = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteGroupCommandError = async ( output , context ) : Promise < DeleteGroupCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteGroupMembershipCommand = async ( output , context ) : Promise < DeleteGroupMembershipCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteGroupMembershipCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteGroupMembershipCommandError = async ( output , context ) : Promise < DeleteGroupMembershipCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteIAMPolicyAssignmentCommand = async ( output , context ) : Promise < DeleteIAMPolicyAssignmentCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteIAMPolicyAssignmentCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AssignmentName : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AssignmentName !== undefined && data . AssignmentName !== null ) { contents . AssignmentName = __expectString ( data . AssignmentName ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteIAMPolicyAssignmentCommandError = async ( output , context ) : Promise < DeleteIAMPolicyAssignmentCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConcurrentUpdatingException" : case "com.amazonaws.quicksight#ConcurrentUpdatingException" : response = { ... ( await deserializeAws_restJson1ConcurrentUpdatingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteNamespaceCommand = async ( output , context ) : Promise < DeleteNamespaceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteNamespaceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteNamespaceCommandError = async ( output , context ) : Promise < DeleteNamespaceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteTemplateCommand = async ( output , context ) : Promise < DeleteTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , RequestId : undefined , Status : undefined , TemplateId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteTemplateCommandError = async ( output , context ) : Promise < DeleteTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteTemplateAliasCommand = async ( output , context ) : Promise < DeleteTemplateAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteTemplateAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AliasName : undefined , Arn : undefined , RequestId : undefined , Status : undefined , TemplateId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AliasName !== undefined && data . AliasName !== null ) { contents . AliasName = __expectString ( data . AliasName ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteTemplateAliasCommandError = async ( output , context ) : Promise < DeleteTemplateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteThemeCommand = async ( output , context ) : Promise < DeleteThemeCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteThemeCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , RequestId : undefined , Status : undefined , ThemeId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteThemeCommandError = async ( output , context ) : Promise < DeleteThemeCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteThemeAliasCommand = async ( output , context ) : Promise < DeleteThemeAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteThemeAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AliasName : undefined , Arn : undefined , RequestId : undefined , Status : undefined , ThemeId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AliasName !== undefined && data . AliasName !== null ) { contents . AliasName = __expectString ( data . AliasName ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteThemeAliasCommandError = async ( output , context ) : Promise < DeleteThemeAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DeleteUserCommand = async ( output , context ) : Promise < DeleteUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteUserCommandError = async ( output , context ) : Promise < DeleteUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DeleteUserByPrincipalIdCommand = async ( output , context ) : Promise < DeleteUserByPrincipalIdCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DeleteUserByPrincipalIdCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DeleteUserByPrincipalIdCommandError = async ( output , context ) : Promise < DeleteUserByPrincipalIdCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeAccountCustomizationCommand = async ( output , context ) : Promise < DescribeAccountCustomizationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeAccountCustomizationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AccountCustomization : undefined , Arn : undefined , AwsAccountId : undefined , Namespace : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AccountCustomization !== undefined && data . AccountCustomization !== null ) { contents . AccountCustomization = deserializeAws_restJson1AccountCustomization ( data . AccountCustomization , context ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . AwsAccountId !== undefined && data . AwsAccountId !== null ) { contents . AwsAccountId = __expectString ( data . AwsAccountId ) ; } if ( data . Namespace !== undefined && data . Namespace !== null ) { contents . Namespace = __expectString ( data . Namespace ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeAccountCustomizationCommandError = async ( output , context ) : Promise < DescribeAccountCustomizationCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeAccountSettingsCommand = async ( output , context ) : Promise < DescribeAccountSettingsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeAccountSettingsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AccountSettings : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AccountSettings !== undefined && data . AccountSettings !== null ) { contents . AccountSettings = deserializeAws_restJson1AccountSettings ( data . AccountSettings , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeAccountSettingsCommandError = async ( output , context ) : Promise < DescribeAccountSettingsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeAnalysisCommand = async ( output , context ) : Promise < DescribeAnalysisCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeAnalysisCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Analysis : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Analysis !== undefined && data . Analysis !== null ) { contents . Analysis = deserializeAws_restJson1Analysis ( data . Analysis , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeAnalysisCommandError = async ( output , context ) : Promise < DescribeAnalysisCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeAnalysisPermissionsCommand = async ( output , context ) : Promise < DescribeAnalysisPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeAnalysisPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisArn : undefined , AnalysisId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisArn !== undefined && data . AnalysisArn !== null ) { contents . AnalysisArn = __expectString ( data . AnalysisArn ) ; } if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeAnalysisPermissionsCommandError = async ( output , context ) : Promise < DescribeAnalysisPermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeDashboardCommand = async ( output , context ) : Promise < DescribeDashboardCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDashboardCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Dashboard : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Dashboard !== undefined && data . Dashboard !== null ) { contents . Dashboard = deserializeAws_restJson1Dashboard ( data . Dashboard , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDashboardCommandError = async ( output , context ) : Promise < DescribeDashboardCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeDashboardPermissionsCommand = async ( output , context ) : Promise < DescribeDashboardPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDashboardPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardArn : undefined , DashboardId : undefined , LinkSharingConfiguration : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardArn !== undefined && data . DashboardArn !== null ) { contents . DashboardArn = __expectString ( data . DashboardArn ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . LinkSharingConfiguration !== undefined && data . LinkSharingConfiguration !== null ) { contents . LinkSharingConfiguration = deserializeAws_restJson1LinkSharingConfiguration ( data . LinkSharingConfiguration , context ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDashboardPermissionsCommandError = async ( output , context ) : Promise < DescribeDashboardPermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeDataSetCommand = async ( output , context ) : Promise < DescribeDataSetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDataSetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSet : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSet !== undefined && data . DataSet !== null ) { contents . DataSet = deserializeAws_restJson1DataSet ( data . DataSet , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDataSetCommandError = async ( output , context ) : Promise < DescribeDataSetCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeDataSetPermissionsCommand = async ( output , context ) : Promise < DescribeDataSetPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDataSetPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSetArn : undefined , DataSetId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSetArn !== undefined && data . DataSetArn !== null ) { contents . DataSetArn = __expectString ( data . DataSetArn ) ; } if ( data . DataSetId !== undefined && data . DataSetId !== null ) { contents . DataSetId = __expectString ( data . DataSetId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDataSetPermissionsCommandError = async ( output , context ) : Promise < DescribeDataSetPermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeDataSourceCommand = async ( output , context ) : Promise < DescribeDataSourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDataSourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSource : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSource !== undefined && data . DataSource !== null ) { contents . DataSource = deserializeAws_restJson1DataSource ( data . DataSource , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDataSourceCommandError = async ( output , context ) : Promise < DescribeDataSourceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeDataSourcePermissionsCommand = async ( output , context ) : Promise < DescribeDataSourcePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeDataSourcePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSourceArn : undefined , DataSourceId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSourceArn !== undefined && data . DataSourceArn !== null ) { contents . DataSourceArn = __expectString ( data . DataSourceArn ) ; } if ( data . DataSourceId !== undefined && data . DataSourceId !== null ) { contents . DataSourceId = __expectString ( data . DataSourceId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeDataSourcePermissionsCommandError = async ( output , context ) : Promise < DescribeDataSourcePermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeFolderCommand = async ( output , context ) : Promise < DescribeFolderCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeFolderCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Folder : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Folder !== undefined && data . Folder !== null ) { contents . Folder = deserializeAws_restJson1Folder ( data . Folder , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeFolderCommandError = async ( output , context ) : Promise < DescribeFolderCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeFolderPermissionsCommand = async ( output , context ) : Promise < DescribeFolderPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeFolderPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeFolderPermissionsCommandError = async ( output , context ) : Promise < DescribeFolderPermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeFolderResolvedPermissionsCommand = async ( output , context ) : Promise < DescribeFolderResolvedPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeFolderResolvedPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeFolderResolvedPermissionsCommandError = async ( output , context ) : Promise < DescribeFolderResolvedPermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeGroupCommand = async ( output , context ) : Promise < DescribeGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Group : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Group !== undefined && data . Group !== null ) { contents . Group = deserializeAws_restJson1Group ( data . Group , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeGroupCommandError = async ( output , context ) : Promise < DescribeGroupCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeIAMPolicyAssignmentCommand = async ( output , context ) : Promise < DescribeIAMPolicyAssignmentCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeIAMPolicyAssignmentCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , IAMPolicyAssignment : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . IAMPolicyAssignment !== undefined && data . IAMPolicyAssignment !== null ) { contents . IAMPolicyAssignment = deserializeAws_restJson1IAMPolicyAssignment ( data . IAMPolicyAssignment , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeIAMPolicyAssignmentCommandError = async ( output , context ) : Promise < DescribeIAMPolicyAssignmentCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeIngestionCommand = async ( output , context ) : Promise < DescribeIngestionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeIngestionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Ingestion : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Ingestion !== undefined && data . Ingestion !== null ) { contents . Ingestion = deserializeAws_restJson1Ingestion ( data . Ingestion , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeIngestionCommandError = async ( output , context ) : Promise < DescribeIngestionCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeIpRestrictionCommand = async ( output , context ) : Promise < DescribeIpRestrictionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeIpRestrictionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AwsAccountId : undefined , Enabled : undefined , IpRestrictionRuleMap : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AwsAccountId !== undefined && data . AwsAccountId !== null ) { contents . AwsAccountId = __expectString ( data . AwsAccountId ) ; } if ( data . Enabled !== undefined && data . Enabled !== null ) { contents . Enabled = __expectBoolean ( data . Enabled ) ; } if ( data . IpRestrictionRuleMap !== undefined && data . IpRestrictionRuleMap !== null ) { contents . IpRestrictionRuleMap = deserializeAws_restJson1IpRestrictionRuleMap ( data . IpRestrictionRuleMap , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeIpRestrictionCommandError = async ( output , context ) : Promise < DescribeIpRestrictionCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeNamespaceCommand = async ( output , context ) : Promise < DescribeNamespaceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeNamespaceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Namespace : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Namespace !== undefined && data . Namespace !== null ) { contents . Namespace = deserializeAws_restJson1NamespaceInfoV2 ( data . Namespace , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeNamespaceCommandError = async ( output , context ) : Promise < DescribeNamespaceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1DescribeTemplateCommand = async ( output , context ) : Promise < DescribeTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , Template : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Template !== undefined && data . Template !== null ) { contents . Template = deserializeAws_restJson1Template ( data . Template , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeTemplateCommandError = async ( output , context ) : Promise < DescribeTemplateCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeTemplateAliasCommand = async ( output , context ) : Promise < DescribeTemplateAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeTemplateAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , TemplateAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateAlias !== undefined && data . TemplateAlias !== null ) { contents . TemplateAlias = deserializeAws_restJson1TemplateAlias ( data . TemplateAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeTemplateAliasCommandError = async ( output , context ) : Promise < DescribeTemplateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeTemplatePermissionsCommand = async ( output , context ) : Promise < DescribeTemplatePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeTemplatePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Permissions : undefined , RequestId : undefined , Status : undefined , TemplateArn : undefined , TemplateId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateArn !== undefined && data . TemplateArn !== null ) { contents . TemplateArn = __expectString ( data . TemplateArn ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeTemplatePermissionsCommandError = async ( output , context ) : Promise < DescribeTemplatePermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeThemeCommand = async ( output , context ) : Promise < DescribeThemeCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeThemeCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , Theme : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Theme !== undefined && data . Theme !== null ) { contents . Theme = deserializeAws_restJson1Theme ( data . Theme , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeThemeCommandError = async ( output , context ) : Promise < DescribeThemeCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeThemeAliasCommand = async ( output , context ) : Promise < DescribeThemeAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeThemeAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , ThemeAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeAlias !== undefined && data . ThemeAlias !== null ) { contents . ThemeAlias = deserializeAws_restJson1ThemeAlias ( data . ThemeAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeThemeAliasCommandError = async ( output , context ) : Promise < DescribeThemeAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeThemePermissionsCommand = async ( output , context ) : Promise < DescribeThemePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeThemePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Permissions : undefined , RequestId : undefined , Status : undefined , ThemeArn : undefined , ThemeId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeArn !== undefined && data . ThemeArn !== null ) { contents . ThemeArn = __expectString ( data . ThemeArn ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeThemePermissionsCommandError = async ( output , context ) : Promise < DescribeThemePermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1DescribeUserCommand = async ( output , context ) : Promise < DescribeUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1DescribeUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , User : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . User !== undefined && data . User !== null ) { contents . User = deserializeAws_restJson1User ( data . User , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1DescribeUserCommandError = async ( output , context ) : Promise < DescribeUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1GenerateEmbedUrlForAnonymousUserCommand = async ( output , context ) : Promise < GenerateEmbedUrlForAnonymousUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , EmbedUrl : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . EmbedUrl !== undefined && data . EmbedUrl !== null ) { contents . EmbedUrl = __expectString ( data . EmbedUrl ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1GenerateEmbedUrlForAnonymousUserCommandError = async ( output , context ) : Promise < GenerateEmbedUrlForAnonymousUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SessionLifetimeInMinutesInvalidException" : case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException" : response = { ... ( await deserializeAws_restJson1SessionLifetimeInMinutesInvalidExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedPricingPlanException" : case "com.amazonaws.quicksight#UnsupportedPricingPlanException" : response = { ... ( await deserializeAws_restJson1UnsupportedPricingPlanExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1GenerateEmbedUrlForRegisteredUserCommand = async ( output , context ) : Promise < GenerateEmbedUrlForRegisteredUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , EmbedUrl : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . EmbedUrl !== undefined && data . EmbedUrl !== null ) { contents . EmbedUrl = __expectString ( data . EmbedUrl ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1GenerateEmbedUrlForRegisteredUserCommandError = async ( output , context ) : Promise < GenerateEmbedUrlForRegisteredUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "QuickSightUserNotFoundException" : case "com.amazonaws.quicksight#QuickSightUserNotFoundException" : response = { ... ( await deserializeAws_restJson1QuickSightUserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SessionLifetimeInMinutesInvalidException" : case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException" : response = { ... ( await deserializeAws_restJson1SessionLifetimeInMinutesInvalidExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedPricingPlanException" : case "com.amazonaws.quicksight#UnsupportedPricingPlanException" : response = { ... ( await deserializeAws_restJson1UnsupportedPricingPlanExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1GetDashboardEmbedUrlCommand = async ( output , context ) : Promise < GetDashboardEmbedUrlCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1GetDashboardEmbedUrlCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , EmbedUrl : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . EmbedUrl !== undefined && data . EmbedUrl !== null ) { contents . EmbedUrl = __expectString ( data . EmbedUrl ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1GetDashboardEmbedUrlCommandError = async ( output , context ) : Promise < GetDashboardEmbedUrlCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "DomainNotWhitelistedException" : case "com.amazonaws.quicksight#DomainNotWhitelistedException" : response = { ... ( await deserializeAws_restJson1DomainNotWhitelistedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "IdentityTypeNotSupportedException" : case "com.amazonaws.quicksight#IdentityTypeNotSupportedException" : response = { ... ( await deserializeAws_restJson1IdentityTypeNotSupportedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "QuickSightUserNotFoundException" : case "com.amazonaws.quicksight#QuickSightUserNotFoundException" : response = { ... ( await deserializeAws_restJson1QuickSightUserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SessionLifetimeInMinutesInvalidException" : case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException" : response = { ... ( await deserializeAws_restJson1SessionLifetimeInMinutesInvalidExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedPricingPlanException" : case "com.amazonaws.quicksight#UnsupportedPricingPlanException" : response = { ... ( await deserializeAws_restJson1UnsupportedPricingPlanExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1GetSessionEmbedUrlCommand = async ( output , context ) : Promise < GetSessionEmbedUrlCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1GetSessionEmbedUrlCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , EmbedUrl : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . EmbedUrl !== undefined && data . EmbedUrl !== null ) { contents . EmbedUrl = __expectString ( data . EmbedUrl ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1GetSessionEmbedUrlCommandError = async ( output , context ) : Promise < GetSessionEmbedUrlCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "QuickSightUserNotFoundException" : case "com.amazonaws.quicksight#QuickSightUserNotFoundException" : response = { ... ( await deserializeAws_restJson1QuickSightUserNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "SessionLifetimeInMinutesInvalidException" : case "com.amazonaws.quicksight#SessionLifetimeInMinutesInvalidException" : response = { ... ( await deserializeAws_restJson1SessionLifetimeInMinutesInvalidExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListAnalysesCommand = async ( output , context ) : Promise < ListAnalysesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListAnalysesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisSummaryList !== undefined && data . AnalysisSummaryList !== null ) { contents . AnalysisSummaryList = deserializeAws_restJson1AnalysisSummaryList ( data . AnalysisSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListAnalysesCommandError = async ( output , context ) : Promise < ListAnalysesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListDashboardsCommand = async ( output , context ) : Promise < ListDashboardsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListDashboardsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardSummaryList !== undefined && data . DashboardSummaryList !== null ) { contents . DashboardSummaryList = deserializeAws_restJson1DashboardSummaryList ( data . DashboardSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListDashboardsCommandError = async ( output , context ) : Promise < ListDashboardsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListDashboardVersionsCommand = async ( output , context ) : Promise < ListDashboardVersionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListDashboardVersionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardVersionSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardVersionSummaryList !== undefined && data . DashboardVersionSummaryList !== null ) { contents . DashboardVersionSummaryList = deserializeAws_restJson1DashboardVersionSummaryList ( data . DashboardVersionSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListDashboardVersionsCommandError = async ( output , context ) : Promise < ListDashboardVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListDataSetsCommand = async ( output , context ) : Promise < ListDataSetsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListDataSetsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSetSummaries : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSetSummaries !== undefined && data . DataSetSummaries !== null ) { contents . DataSetSummaries = deserializeAws_restJson1DataSetSummaryList ( data . DataSetSummaries , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListDataSetsCommandError = async ( output , context ) : Promise < ListDataSetsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListDataSourcesCommand = async ( output , context ) : Promise < ListDataSourcesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListDataSourcesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSources : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSources !== undefined && data . DataSources !== null ) { contents . DataSources = deserializeAws_restJson1DataSourceList ( data . DataSources , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListDataSourcesCommandError = async ( output , context ) : Promise < ListDataSourcesCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListFolderMembersCommand = async ( output , context ) : Promise < ListFolderMembersCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListFolderMembersCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FolderMemberList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . FolderMemberList !== undefined && data . FolderMemberList !== null ) { contents . FolderMemberList = deserializeAws_restJson1FolderMemberList ( data . FolderMemberList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListFolderMembersCommandError = async ( output , context ) : Promise < ListFolderMembersCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListFoldersCommand = async ( output , context ) : Promise < ListFoldersCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListFoldersCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FolderSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . FolderSummaryList !== undefined && data . FolderSummaryList !== null ) { contents . FolderSummaryList = deserializeAws_restJson1FolderSummaryList ( data . FolderSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListFoldersCommandError = async ( output , context ) : Promise < ListFoldersCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListGroupMembershipsCommand = async ( output , context ) : Promise < ListGroupMembershipsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListGroupMembershipsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , GroupMemberList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . GroupMemberList !== undefined && data . GroupMemberList !== null ) { contents . GroupMemberList = deserializeAws_restJson1GroupMemberList ( data . GroupMemberList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListGroupMembershipsCommandError = async ( output , context ) : Promise < ListGroupMembershipsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListGroupsCommand = async ( output , context ) : Promise < ListGroupsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListGroupsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , GroupList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . GroupList !== undefined && data . GroupList !== null ) { contents . GroupList = deserializeAws_restJson1GroupList ( data . GroupList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListGroupsCommandError = async ( output , context ) : Promise < ListGroupsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListIAMPolicyAssignmentsCommand = async ( output , context ) : Promise < ListIAMPolicyAssignmentsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListIAMPolicyAssignmentsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , IAMPolicyAssignments : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . IAMPolicyAssignments !== undefined && data . IAMPolicyAssignments !== null ) { contents . IAMPolicyAssignments = deserializeAws_restJson1IAMPolicyAssignmentSummaryList ( data . IAMPolicyAssignments , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListIAMPolicyAssignmentsCommandError = async ( output , context ) : Promise < ListIAMPolicyAssignmentsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListIAMPolicyAssignmentsForUserCommand = async ( output , context ) : Promise < ListIAMPolicyAssignmentsForUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , ActiveAssignments : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . ActiveAssignments !== undefined && data . ActiveAssignments !== null ) { contents . ActiveAssignments = deserializeAws_restJson1ActiveIAMPolicyAssignmentList ( data . ActiveAssignments , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListIAMPolicyAssignmentsForUserCommandError = async ( output , context ) : Promise < ListIAMPolicyAssignmentsForUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConcurrentUpdatingException" : case "com.amazonaws.quicksight#ConcurrentUpdatingException" : response = { ... ( await deserializeAws_restJson1ConcurrentUpdatingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListIngestionsCommand = async ( output , context ) : Promise < ListIngestionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListIngestionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Ingestions : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Ingestions !== undefined && data . Ingestions !== null ) { contents . Ingestions = deserializeAws_restJson1Ingestions ( data . Ingestions , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListIngestionsCommandError = async ( output , context ) : Promise < ListIngestionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListNamespacesCommand = async ( output , context ) : Promise < ListNamespacesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListNamespacesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Namespaces : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Namespaces !== undefined && data . Namespaces !== null ) { contents . Namespaces = deserializeAws_restJson1Namespaces ( data . Namespaces , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListNamespacesCommandError = async ( output , context ) : Promise < ListNamespacesCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListTagsForResourceCommand = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListTagsForResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , Tags : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Tags !== undefined && data . Tags !== null ) { contents . Tags = deserializeAws_restJson1TagList ( data . Tags , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListTagsForResourceCommandError = async ( output , context ) : Promise < ListTagsForResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListTemplateAliasesCommand = async ( output , context ) : Promise < ListTemplateAliasesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListTemplateAliasesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , TemplateAliasList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateAliasList !== undefined && data . TemplateAliasList !== null ) { contents . TemplateAliasList = deserializeAws_restJson1TemplateAliasList ( data . TemplateAliasList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListTemplateAliasesCommandError = async ( output , context ) : Promise < ListTemplateAliasesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListTemplatesCommand = async ( output , context ) : Promise < ListTemplatesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListTemplatesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , TemplateSummaryList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateSummaryList !== undefined && data . TemplateSummaryList !== null ) { contents . TemplateSummaryList = deserializeAws_restJson1TemplateSummaryList ( data . TemplateSummaryList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListTemplatesCommandError = async ( output , context ) : Promise < ListTemplatesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListTemplateVersionsCommand = async ( output , context ) : Promise < ListTemplateVersionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListTemplateVersionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , TemplateVersionSummaryList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateVersionSummaryList !== undefined && data . TemplateVersionSummaryList !== null ) { contents . TemplateVersionSummaryList = deserializeAws_restJson1TemplateVersionSummaryList ( data . TemplateVersionSummaryList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListTemplateVersionsCommandError = async ( output , context ) : Promise < ListTemplateVersionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListThemeAliasesCommand = async ( output , context ) : Promise < ListThemeAliasesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListThemeAliasesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , ThemeAliasList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeAliasList !== undefined && data . ThemeAliasList !== null ) { contents . ThemeAliasList = deserializeAws_restJson1ThemeAliasList ( data . ThemeAliasList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListThemeAliasesCommandError = async ( output , context ) : Promise < ListThemeAliasesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListThemesCommand = async ( output , context ) : Promise < ListThemesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListThemesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , ThemeSummaryList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeSummaryList !== undefined && data . ThemeSummaryList !== null ) { contents . ThemeSummaryList = deserializeAws_restJson1ThemeSummaryList ( data . ThemeSummaryList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListThemesCommandError = async ( output , context ) : Promise < ListThemesCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListThemeVersionsCommand = async ( output , context ) : Promise < ListThemeVersionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListThemeVersionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , ThemeVersionSummaryList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeVersionSummaryList !== undefined && data . ThemeVersionSummaryList !== null ) { contents . ThemeVersionSummaryList = deserializeAws_restJson1ThemeVersionSummaryList ( data . ThemeVersionSummaryList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListThemeVersionsCommandError = async ( output , context ) : Promise < ListThemeVersionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1ListUserGroupsCommand = async ( output , context ) : Promise < ListUserGroupsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListUserGroupsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , GroupList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . GroupList !== undefined && data . GroupList !== null ) { contents . GroupList = deserializeAws_restJson1GroupList ( data . GroupList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListUserGroupsCommandError = async ( output , context ) : Promise < ListUserGroupsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1ListUsersCommand = async ( output , context ) : Promise < ListUsersCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1ListUsersCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , NextToken : undefined , RequestId : undefined , Status : undefined , UserList : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . UserList !== undefined && data . UserList !== null ) { contents . UserList = deserializeAws_restJson1UserList ( data . UserList , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1ListUsersCommandError = async ( output , context ) : Promise < ListUsersCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1RegisterUserCommand = async ( output , context ) : Promise < RegisterUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1RegisterUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , User : undefined , UserInvitationUrl : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . User !== undefined && data . User !== null ) { contents . User = deserializeAws_restJson1User ( data . User , context ) ; } if ( data . UserInvitationUrl !== undefined && data . UserInvitationUrl !== null ) { contents . UserInvitationUrl = __expectString ( data . UserInvitationUrl ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1RegisterUserCommandError = async ( output , context ) : Promise < RegisterUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1RestoreAnalysisCommand = async ( output , context ) : Promise < RestoreAnalysisCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1RestoreAnalysisCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisId : undefined , Arn : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1RestoreAnalysisCommandError = async ( output , context ) : Promise < RestoreAnalysisCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1SearchAnalysesCommand = async ( output , context ) : Promise < SearchAnalysesCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1SearchAnalysesCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisSummaryList !== undefined && data . AnalysisSummaryList !== null ) { contents . AnalysisSummaryList = deserializeAws_restJson1AnalysisSummaryList ( data . AnalysisSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1SearchAnalysesCommandError = async ( output , context ) : Promise < SearchAnalysesCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1SearchDashboardsCommand = async ( output , context ) : Promise < SearchDashboardsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1SearchDashboardsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardSummaryList !== undefined && data . DashboardSummaryList !== null ) { contents . DashboardSummaryList = deserializeAws_restJson1DashboardSummaryList ( data . DashboardSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1SearchDashboardsCommandError = async ( output , context ) : Promise < SearchDashboardsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1SearchFoldersCommand = async ( output , context ) : Promise < SearchFoldersCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1SearchFoldersCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , FolderSummaryList : undefined , NextToken : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . FolderSummaryList !== undefined && data . FolderSummaryList !== null ) { contents . FolderSummaryList = deserializeAws_restJson1FolderSummaryList ( data . FolderSummaryList , context ) ; } if ( data . NextToken !== undefined && data . NextToken !== null ) { contents . NextToken = __expectString ( data . NextToken ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1SearchFoldersCommandError = async ( output , context ) : Promise < SearchFoldersCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidNextTokenException" : case "com.amazonaws.quicksight#InvalidNextTokenException" : response = { ... ( await deserializeAws_restJson1InvalidNextTokenExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1TagResourceCommand = async ( output , context ) : Promise < TagResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1TagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1TagResourceCommandError = async ( output , context ) : Promise < TagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UntagResourceCommand = async ( output , context ) : Promise < UntagResourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UntagResourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UntagResourceCommandError = async ( output , context ) : Promise < UntagResourceCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateAccountCustomizationCommand = async ( output , context ) : Promise < UpdateAccountCustomizationCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateAccountCustomizationCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AccountCustomization : undefined , Arn : undefined , AwsAccountId : undefined , Namespace : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AccountCustomization !== undefined && data . AccountCustomization !== null ) { contents . AccountCustomization = deserializeAws_restJson1AccountCustomization ( data . AccountCustomization , context ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . AwsAccountId !== undefined && data . AwsAccountId !== null ) { contents . AwsAccountId = __expectString ( data . AwsAccountId ) ; } if ( data . Namespace !== undefined && data . Namespace !== null ) { contents . Namespace = __expectString ( data . Namespace ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateAccountCustomizationCommandError = async ( output , context ) : Promise < UpdateAccountCustomizationCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateAccountSettingsCommand = async ( output , context ) : Promise < UpdateAccountSettingsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateAccountSettingsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateAccountSettingsCommandError = async ( output , context ) : Promise < UpdateAccountSettingsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "AccessDeniedException" : case "com.amazonaws.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateAnalysisCommand = async ( output , context ) : Promise < UpdateAnalysisCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateAnalysisCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisId : undefined , Arn : undefined , RequestId : undefined , Status : undefined , UpdateStatus : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . UpdateStatus !== undefined && data . UpdateStatus !== null ) { contents . UpdateStatus = __expectString ( data . UpdateStatus ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateAnalysisCommandError = async ( output , context ) : Promise < UpdateAnalysisCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateAnalysisPermissionsCommand = async ( output , context ) : Promise < UpdateAnalysisPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateAnalysisPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AnalysisArn : undefined , AnalysisId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AnalysisArn !== undefined && data . AnalysisArn !== null ) { contents . AnalysisArn = __expectString ( data . AnalysisArn ) ; } if ( data . AnalysisId !== undefined && data . AnalysisId !== null ) { contents . AnalysisId = __expectString ( data . AnalysisId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateAnalysisPermissionsCommandError = async ( output , context ) : Promise < UpdateAnalysisPermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateDashboardCommand = async ( output , context ) : Promise < UpdateDashboardCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDashboardCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , DashboardId : undefined , RequestId : undefined , Status : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Status !== undefined && data . Status !== null ) { contents . Status = __expectInt32 ( data . Status ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDashboardCommandError = async ( output , context ) : Promise < UpdateDashboardCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateDashboardPermissionsCommand = async ( output , context ) : Promise < UpdateDashboardPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDashboardPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardArn : undefined , DashboardId : undefined , LinkSharingConfiguration : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardArn !== undefined && data . DashboardArn !== null ) { contents . DashboardArn = __expectString ( data . DashboardArn ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . LinkSharingConfiguration !== undefined && data . LinkSharingConfiguration !== null ) { contents . LinkSharingConfiguration = deserializeAws_restJson1LinkSharingConfiguration ( data . LinkSharingConfiguration , context ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDashboardPermissionsCommandError = async ( output , context ) : Promise < UpdateDashboardPermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateDashboardPublishedVersionCommand = async ( output , context ) : Promise < UpdateDashboardPublishedVersionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDashboardPublishedVersionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DashboardArn : undefined , DashboardId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DashboardArn !== undefined && data . DashboardArn !== null ) { contents . DashboardArn = __expectString ( data . DashboardArn ) ; } if ( data . DashboardId !== undefined && data . DashboardId !== null ) { contents . DashboardId = __expectString ( data . DashboardId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDashboardPublishedVersionCommandError = async ( output , context ) : Promise < UpdateDashboardPublishedVersionCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateDataSetCommand = async ( output , context ) : Promise < UpdateDataSetCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDataSetCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DataSetId : undefined , IngestionArn : undefined , IngestionId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DataSetId !== undefined && data . DataSetId !== null ) { contents . DataSetId = __expectString ( data . DataSetId ) ; } if ( data . IngestionArn !== undefined && data . IngestionArn !== null ) { contents . IngestionArn = __expectString ( data . IngestionArn ) ; } if ( data . IngestionId !== undefined && data . IngestionId !== null ) { contents . IngestionId = __expectString ( data . IngestionId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDataSetCommandError = async ( output , context ) : Promise < UpdateDataSetCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateDataSetPermissionsCommand = async ( output , context ) : Promise < UpdateDataSetPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDataSetPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSetArn : undefined , DataSetId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSetArn !== undefined && data . DataSetArn !== null ) { contents . DataSetArn = __expectString ( data . DataSetArn ) ; } if ( data . DataSetId !== undefined && data . DataSetId !== null ) { contents . DataSetId = __expectString ( data . DataSetId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDataSetPermissionsCommandError = async ( output , context ) : Promise < UpdateDataSetPermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateDataSourceCommand = async ( output , context ) : Promise < UpdateDataSourceCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDataSourceCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , DataSourceId : undefined , RequestId : undefined , Status : undefined , UpdateStatus : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . DataSourceId !== undefined && data . DataSourceId !== null ) { contents . DataSourceId = __expectString ( data . DataSourceId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . UpdateStatus !== undefined && data . UpdateStatus !== null ) { contents . UpdateStatus = __expectString ( data . UpdateStatus ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDataSourceCommandError = async ( output , context ) : Promise < UpdateDataSourceCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateDataSourcePermissionsCommand = async ( output , context ) : Promise < UpdateDataSourcePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateDataSourcePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , DataSourceArn : undefined , DataSourceId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . DataSourceArn !== undefined && data . DataSourceArn !== null ) { contents . DataSourceArn = __expectString ( data . DataSourceArn ) ; } if ( data . DataSourceId !== undefined && data . DataSourceId !== null ) { contents . DataSourceId = __expectString ( data . DataSourceId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateDataSourcePermissionsCommandError = async ( output , context ) : Promise < UpdateDataSourcePermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateFolderCommand = async ( output , context ) : Promise < UpdateFolderCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateFolderCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateFolderCommandError = async ( output , context ) : Promise < UpdateFolderCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateFolderPermissionsCommand = async ( output , context ) : Promise < UpdateFolderPermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateFolderPermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , FolderId : undefined , Permissions : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . FolderId !== undefined && data . FolderId !== null ) { contents . FolderId = __expectString ( data . FolderId ) ; } if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . Status !== undefined && data . Status !== null ) { contents . Status = __expectInt32 ( data . Status ) ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateFolderPermissionsCommandError = async ( output , context ) : Promise < UpdateFolderPermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateGroupCommand = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateGroupCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Group : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Group !== undefined && data . Group !== null ) { contents . Group = deserializeAws_restJson1Group ( data . Group , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateGroupCommandError = async ( output , context ) : Promise < UpdateGroupCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateIAMPolicyAssignmentCommand = async ( output , context ) : Promise < UpdateIAMPolicyAssignmentCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateIAMPolicyAssignmentCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AssignmentId : undefined , AssignmentName : undefined , AssignmentStatus : undefined , Identities : undefined , PolicyArn : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AssignmentId !== undefined && data . AssignmentId !== null ) { contents . AssignmentId = __expectString ( data . AssignmentId ) ; } if ( data . AssignmentName !== undefined && data . AssignmentName !== null ) { contents . AssignmentName = __expectString ( data . AssignmentName ) ; } if ( data . AssignmentStatus !== undefined && data . AssignmentStatus !== null ) { contents . AssignmentStatus = __expectString ( data . AssignmentStatus ) ; } if ( data . Identities !== undefined && data . Identities !== null ) { contents . Identities = deserializeAws_restJson1IdentityMap ( data . Identities , context ) ; } if ( data . PolicyArn !== undefined && data . PolicyArn !== null ) { contents . PolicyArn = __expectString ( data . PolicyArn ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateIAMPolicyAssignmentCommandError = async ( output , context ) : Promise < UpdateIAMPolicyAssignmentCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ConcurrentUpdatingException" : case "com.amazonaws.quicksight#ConcurrentUpdatingException" : response = { ... ( await deserializeAws_restJson1ConcurrentUpdatingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateIpRestrictionCommand = async ( output , context ) : Promise < UpdateIpRestrictionCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateIpRestrictionCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , AwsAccountId : undefined , RequestId : undefined , Status : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . AwsAccountId !== undefined && data . AwsAccountId !== null ) { contents . AwsAccountId = __expectString ( data . AwsAccountId ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateIpRestrictionCommandError = async ( output , context ) : Promise < UpdateIpRestrictionCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1UpdateTemplateCommand = async ( output , context ) : Promise < UpdateTemplateCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateTemplateCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , RequestId : undefined , Status : undefined , TemplateId : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateTemplateCommandError = async ( output , context ) : Promise < UpdateTemplateCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateTemplateAliasCommand = async ( output , context ) : Promise < UpdateTemplateAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateTemplateAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , TemplateAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateAlias !== undefined && data . TemplateAlias !== null ) { contents . TemplateAlias = deserializeAws_restJson1TemplateAlias ( data . TemplateAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateTemplateAliasCommandError = async ( output , context ) : Promise < UpdateTemplateAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateTemplatePermissionsCommand = async ( output , context ) : Promise < UpdateTemplatePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateTemplatePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Permissions : undefined , RequestId : undefined , Status : undefined , TemplateArn : undefined , TemplateId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . TemplateArn !== undefined && data . TemplateArn !== null ) { contents . TemplateArn = __expectString ( data . TemplateArn ) ; } if ( data . TemplateId !== undefined && data . TemplateId !== null ) { contents . TemplateId = __expectString ( data . TemplateId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateTemplatePermissionsCommandError = async ( output , context ) : Promise < UpdateTemplatePermissionsCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateThemeCommand = async ( output , context ) : Promise < UpdateThemeCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateThemeCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Arn : undefined , CreationStatus : undefined , RequestId : undefined , Status : undefined , ThemeId : undefined , VersionArn : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Arn !== undefined && data . Arn !== null ) { contents . Arn = __expectString ( data . Arn ) ; } if ( data . CreationStatus !== undefined && data . CreationStatus !== null ) { contents . CreationStatus = __expectString ( data . CreationStatus ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( data . VersionArn !== undefined && data . VersionArn !== null ) { contents . VersionArn = __expectString ( data . VersionArn ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateThemeCommandError = async ( output , context ) : Promise < UpdateThemeCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "LimitExceededException" : case "com.amazonaws.quicksight#LimitExceededException" : response = { ... ( await deserializeAws_restJson1LimitExceededExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateThemeAliasCommand = async ( output , context ) : Promise < UpdateThemeAliasCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateThemeAliasCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , ThemeAlias : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeAlias !== undefined && data . ThemeAlias !== null ) { contents . ThemeAlias = deserializeAws_restJson1ThemeAlias ( data . ThemeAlias , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateThemeAliasCommandError = async ( output , context ) : Promise < UpdateThemeAliasCommandOutput > => { const parsedOutput = { ... output , body : await parseBody ( output . body , context ) , } ; let response ; let errorCode = "UnknownError" ; errorCode = loadRestJsonErrorCode ( output , parsedOutput . body ) ; switch ( errorCode ) { case "ConflictException" : case "com.amazonaws.quicksight#ConflictException" : response = { ... ( await deserializeAws_restJson1ConflictExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceExistsException" : case "com.amazonaws.quicksight#ResourceExistsException" : response = { ... ( await deserializeAws_restJson1ResourceExistsExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateThemePermissionsCommand = async ( output , context ) : Promise < UpdateThemePermissionsCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateThemePermissionsCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , Permissions : undefined , RequestId : undefined , Status : undefined , ThemeArn : undefined , ThemeId : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . Permissions !== undefined && data . Permissions !== null ) { contents . Permissions = deserializeAws_restJson1ResourcePermissionList ( data . Permissions , context ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ThemeArn !== undefined && data . ThemeArn !== null ) { contents . ThemeArn = __expectString ( data . ThemeArn ) ; } if ( data . ThemeId !== undefined && data . ThemeId !== null ) { contents . ThemeId = __expectString ( data . ThemeId ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateThemePermissionsCommandError = async ( output , context ) : Promise < UpdateThemePermissionsCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "UnsupportedUserEditionException" : case "com.amazonaws.quicksight#UnsupportedUserEditionException" : response = { ... ( await deserializeAws_restJson1UnsupportedUserEditionExceptionResponse ( 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_restJson1UpdateUserCommand = async ( output , context ) : Promise < UpdateUserCommandOutput > => { if ( output . statusCode !== 200 && output . statusCode >= 300 ) { return deserializeAws_restJson1UpdateUserCommandError ( output , context ) ; } const contents = { $metadata : deserializeMetadata ( output ) , RequestId : undefined , Status : undefined , User : undefined , } ; const data = __expectNonNull ( __expectObject ( await parseBody ( output . body , context ) ) , "body" ) ; if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . User !== undefined && data . User !== null ) { contents . User = deserializeAws_restJson1User ( data . User , context ) ; } if ( contents . Status === undefined ) { contents . Status = output . statusCode ; } return Promise . resolve ( contents ) ; } ; const deserializeAws_restJson1UpdateUserCommandError = async ( output , context ) : Promise < UpdateUserCommandOutput > => { 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.quicksight#AccessDeniedException" : response = { ... ( await deserializeAws_restJson1AccessDeniedExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InternalFailureException" : case "com.amazonaws.quicksight#InternalFailureException" : response = { ... ( await deserializeAws_restJson1InternalFailureExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "InvalidParameterValueException" : case "com.amazonaws.quicksight#InvalidParameterValueException" : response = { ... ( await deserializeAws_restJson1InvalidParameterValueExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "PreconditionNotMetException" : case "com.amazonaws.quicksight#PreconditionNotMetException" : response = { ... ( await deserializeAws_restJson1PreconditionNotMetExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceNotFoundException" : case "com.amazonaws.quicksight#ResourceNotFoundException" : response = { ... ( await deserializeAws_restJson1ResourceNotFoundExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ResourceUnavailableException" : case "com.amazonaws.quicksight#ResourceUnavailableException" : response = { ... ( await deserializeAws_restJson1ResourceUnavailableExceptionResponse ( parsedOutput , context ) ) , name : errorCode , $metadata : deserializeMetadata ( output ) , } ; break ; case "ThrottlingException" : case "com.amazonaws.quicksight#ThrottlingException" : response = { ... ( await deserializeAws_restJson1ThrottlingExceptionResponse ( 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_restJson1AccessDeniedExceptionResponse = async ( parsedOutput , context ) : Promise < AccessDeniedException > => { const contents = { name : "AccessDeniedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1ConcurrentUpdatingExceptionResponse = async ( parsedOutput , context ) : Promise < ConcurrentUpdatingException > => { const contents = { name : "ConcurrentUpdatingException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1ConflictExceptionResponse = async ( parsedOutput , context ) : Promise < ConflictException > => { const contents = { name : "ConflictException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1DomainNotWhitelistedExceptionResponse = async ( parsedOutput , context ) : Promise < DomainNotWhitelistedException > => { const contents = { name : "DomainNotWhitelistedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1IdentityTypeNotSupportedExceptionResponse = async ( parsedOutput , context ) : Promise < IdentityTypeNotSupportedException > => { const contents = { name : "IdentityTypeNotSupportedException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1InternalFailureExceptionResponse = async ( parsedOutput , context ) : Promise < InternalFailureException > => { const contents = { name : "InternalFailureException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1InvalidNextTokenExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidNextTokenException > => { const contents = { name : "InvalidNextTokenException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1InvalidParameterValueExceptionResponse = async ( parsedOutput , context ) : Promise < InvalidParameterValueException > => { const contents = { name : "InvalidParameterValueException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1LimitExceededExceptionResponse = async ( parsedOutput , context ) : Promise < LimitExceededException > => { const contents = { name : "LimitExceededException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , ResourceType : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ResourceType !== undefined && data . ResourceType !== null ) { contents . ResourceType = __expectString ( data . ResourceType ) ; } return contents ; } ; const deserializeAws_restJson1PreconditionNotMetExceptionResponse = async ( parsedOutput , context ) : Promise < PreconditionNotMetException > => { const contents = { name : "PreconditionNotMetException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1QuickSightUserNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < QuickSightUserNotFoundException > => { const contents = { name : "QuickSightUserNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1ResourceExistsExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceExistsException > => { const contents = { name : "ResourceExistsException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , ResourceType : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ResourceType !== undefined && data . ResourceType !== null ) { contents . ResourceType = __expectString ( data . ResourceType ) ; } return contents ; } ; const deserializeAws_restJson1ResourceNotFoundExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceNotFoundException > => { const contents = { name : "ResourceNotFoundException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , ResourceType : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ResourceType !== undefined && data . ResourceType !== null ) { contents . ResourceType = __expectString ( data . ResourceType ) ; } return contents ; } ; const deserializeAws_restJson1ResourceUnavailableExceptionResponse = async ( parsedOutput , context ) : Promise < ResourceUnavailableException > => { const contents = { name : "ResourceUnavailableException" , $fault : "server" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , ResourceType : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } if ( data . ResourceType !== undefined && data . ResourceType !== null ) { contents . ResourceType = __expectString ( data . ResourceType ) ; } return contents ; } ; const deserializeAws_restJson1SessionLifetimeInMinutesInvalidExceptionResponse = async ( parsedOutput , context ) : Promise < SessionLifetimeInMinutesInvalidException > => { const contents = { name : "SessionLifetimeInMinutesInvalidException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1ThrottlingExceptionResponse = async ( parsedOutput , context ) : Promise < ThrottlingException > => { const contents = { name : "ThrottlingException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1UnsupportedPricingPlanExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedPricingPlanException > => { const contents = { name : "UnsupportedPricingPlanException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const deserializeAws_restJson1UnsupportedUserEditionExceptionResponse = async ( parsedOutput , context ) : Promise < UnsupportedUserEditionException > => { const contents = { name : "UnsupportedUserEditionException" , $fault : "client" , $metadata : deserializeMetadata ( parsedOutput ) , Message : undefined , RequestId : undefined , } ; const data = parsedOutput . body ; if ( data . Message !== undefined && data . Message !== null ) { contents . Message = __expectString ( data . Message ) ; } if ( data . RequestId !== undefined && data . RequestId !== null ) { contents . RequestId = __expectString ( data . RequestId ) ; } return contents ; } ; const serializeAws_restJson1AccountCustomization = ( input , context ) : any => { return { ... ( input . DefaultEmailCustomizationTemplate !== undefined && input . DefaultEmailCustomizationTemplate !== null && { DefaultEmailCustomizationTemplate : input . DefaultEmailCustomizationTemplate , } ) , ... ( input . DefaultTheme !== undefined && input . DefaultTheme !== null && { DefaultTheme : input . DefaultTheme } ) , } ; } ; const serializeAws_restJson1ActionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1AdHocFilteringOption = ( input , context ) : any => { return { ... ( input . AvailabilityStatus !== undefined && input . AvailabilityStatus !== null && { AvailabilityStatus : input . AvailabilityStatus } ) , } ; } ; const serializeAws_restJson1AmazonElasticsearchParameters = ( input , context ) : any => { return { ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , } ; } ; const serializeAws_restJson1AmazonOpenSearchParameters = ( input , context ) : any => { return { ... ( input . Domain !== undefined && input . Domain !== null && { Domain : input . Domain } ) , } ; } ; const serializeAws_restJson1AnalysisSearchFilter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Operator !== undefined && input . Operator !== null && { Operator : input . Operator } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_restJson1AnalysisSearchFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1AnalysisSearchFilter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1AnalysisSourceEntity = ( input , context ) : any => { return { ... ( input . SourceTemplate !== undefined && input . SourceTemplate !== null && { SourceTemplate : serializeAws_restJson1AnalysisSourceTemplate ( input . SourceTemplate , context ) , } ) , } ; } ; const serializeAws_restJson1AnalysisSourceTemplate = ( input , context ) : any => { return { ... ( input . Arn !== undefined && input . Arn !== null && { Arn : input . Arn } ) , ... ( input . DataSetReferences !== undefined && input . DataSetReferences !== null && { DataSetReferences : serializeAws_restJson1DataSetReferenceList ( input . DataSetReferences , context ) , } ) , } ; } ; const serializeAws_restJson1AnonymousUserDashboardEmbeddingConfiguration = ( input , context ) : any => { return { ... ( input . InitialDashboardId !== undefined && input . InitialDashboardId !== null && { InitialDashboardId : input . InitialDashboardId } ) , } ; } ; const serializeAws_restJson1AnonymousUserEmbeddingExperienceConfiguration = ( input , context ) : any => { return { ... ( input . Dashboard !== undefined && input . Dashboard !== null && { Dashboard : serializeAws_restJson1AnonymousUserDashboardEmbeddingConfiguration ( input . Dashboard , context ) , } ) , } ; } ; const serializeAws_restJson1ArnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1AthenaParameters = ( input , context ) : any => { return { ... ( input . WorkGroup !== undefined && input . WorkGroup !== null && { WorkGroup : input . WorkGroup } ) , } ; } ; const serializeAws_restJson1AuroraParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1AuroraPostgreSqlParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1AwsIotAnalyticsParameters = ( input , context ) : any => { return { ... ( input . DataSetName !== undefined && input . DataSetName !== null && { DataSetName : input . DataSetName } ) , } ; } ; const serializeAws_restJson1BorderStyle = ( input , context ) : any => { return { ... ( input . Show !== undefined && input . Show !== null && { Show : input . Show } ) , } ; } ; const serializeAws_restJson1CalculatedColumn = ( input , context ) : any => { return { ... ( input . ColumnId !== undefined && input . ColumnId !== null && { ColumnId : input . ColumnId } ) , ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . Expression !== undefined && input . Expression !== null && { Expression : input . Expression } ) , } ; } ; const serializeAws_restJson1CalculatedColumnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1CalculatedColumn ( entry , context ) ; } ) ; } ; const serializeAws_restJson1CastColumnTypeOperation = ( input , context ) : any => { return { ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . Format !== undefined && input . Format !== null && { Format : input . Format } ) , ... ( input . NewColumnType !== undefined && input . NewColumnType !== null && { NewColumnType : input . NewColumnType } ) , } ; } ; const serializeAws_restJson1ColorList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ColumnDescription = ( input , context ) : any => { return { ... ( input . Text !== undefined && input . Text !== null && { Text : input . Text } ) , } ; } ; const serializeAws_restJson1ColumnGroup = ( input , context ) : any => { return { ... ( input . GeoSpatialColumnGroup !== undefined && input . GeoSpatialColumnGroup !== null && { GeoSpatialColumnGroup : serializeAws_restJson1GeoSpatialColumnGroup ( input . GeoSpatialColumnGroup , context ) , } ) , } ; } ; const serializeAws_restJson1ColumnGroupList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ColumnGroup ( entry , context ) ; } ) ; } ; const serializeAws_restJson1ColumnLevelPermissionRule = ( input , context ) : any => { return { ... ( input . ColumnNames !== undefined && input . ColumnNames !== null && { ColumnNames : serializeAws_restJson1ColumnNameList ( input . ColumnNames , context ) } ) , ... ( input . Principals !== undefined && input . Principals !== null && { Principals : serializeAws_restJson1PrincipalList ( input . Principals , context ) } ) , } ; } ; const serializeAws_restJson1ColumnLevelPermissionRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ColumnLevelPermissionRule ( entry , context ) ; } ) ; } ; const serializeAws_restJson1ColumnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ColumnNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ColumnTag = ( input , context ) : any => { return { ... ( input . ColumnDescription !== undefined && input . ColumnDescription !== null && { ColumnDescription : serializeAws_restJson1ColumnDescription ( input . ColumnDescription , context ) , } ) , ... ( input . ColumnGeographicRole !== undefined && input . ColumnGeographicRole !== null && { ColumnGeographicRole : input . ColumnGeographicRole } ) , } ; } ; const serializeAws_restJson1ColumnTagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ColumnTag ( entry , context ) ; } ) ; } ; const serializeAws_restJson1ColumnTagNames = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1CreateColumnsOperation = ( input , context ) : any => { return { ... ( input . Columns !== undefined && input . Columns !== null && { Columns : serializeAws_restJson1CalculatedColumnList ( input . Columns , context ) } ) , } ; } ; const serializeAws_restJson1CredentialPair = ( input , context ) : any => { return { ... ( input . AlternateDataSourceParameters !== undefined && input . AlternateDataSourceParameters !== null && { AlternateDataSourceParameters : serializeAws_restJson1DataSourceParametersList ( input . AlternateDataSourceParameters , context ) , } ) , ... ( input . Password !== undefined && input . Password !== null && { Password : input . Password } ) , ... ( input . Username !== undefined && input . Username !== null && { Username : input . Username } ) , } ; } ; const serializeAws_restJson1CustomSql = ( input , context ) : any => { return { ... ( input . Columns !== undefined && input . Columns !== null && { Columns : serializeAws_restJson1InputColumnList ( input . Columns , context ) } ) , ... ( input . DataSourceArn !== undefined && input . DataSourceArn !== null && { DataSourceArn : input . DataSourceArn } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . SqlQuery !== undefined && input . SqlQuery !== null && { SqlQuery : input . SqlQuery } ) , } ; } ; const serializeAws_restJson1DashboardPublishOptions = ( input , context ) : any => { return { ... ( input . AdHocFilteringOption !== undefined && input . AdHocFilteringOption !== null && { AdHocFilteringOption : serializeAws_restJson1AdHocFilteringOption ( input . AdHocFilteringOption , context ) , } ) , ... ( input . ExportToCSVOption !== undefined && input . ExportToCSVOption !== null && { ExportToCSVOption : serializeAws_restJson1ExportToCSVOption ( input . ExportToCSVOption , context ) , } ) , ... ( input . SheetControlsOption !== undefined && input . SheetControlsOption !== null && { SheetControlsOption : serializeAws_restJson1SheetControlsOption ( input . SheetControlsOption , context ) , } ) , } ; } ; const serializeAws_restJson1DashboardSearchFilter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Operator !== undefined && input . Operator !== null && { Operator : input . Operator } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_restJson1DashboardSearchFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DashboardSearchFilter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DashboardSourceEntity = ( input , context ) : any => { return { ... ( input . SourceTemplate !== undefined && input . SourceTemplate !== null && { SourceTemplate : serializeAws_restJson1DashboardSourceTemplate ( input . SourceTemplate , context ) , } ) , } ; } ; const serializeAws_restJson1DashboardSourceTemplate = ( input , context ) : any => { return { ... ( input . Arn !== undefined && input . Arn !== null && { Arn : input . Arn } ) , ... ( input . DataSetReferences !== undefined && input . DataSetReferences !== null && { DataSetReferences : serializeAws_restJson1DataSetReferenceList ( input . DataSetReferences , context ) , } ) , } ; } ; const serializeAws_restJson1DataColorPalette = ( input , context ) : any => { return { ... ( input . Colors !== undefined && input . Colors !== null && { Colors : serializeAws_restJson1ColorList ( input . Colors , context ) } ) , ... ( input . EmptyFillColor !== undefined && input . EmptyFillColor !== null && { EmptyFillColor : input . EmptyFillColor } ) , ... ( input . MinMaxGradient !== undefined && input . MinMaxGradient !== null && { MinMaxGradient : serializeAws_restJson1ColorList ( input . MinMaxGradient , context ) , } ) , } ; } ; const serializeAws_restJson1DataSetReference = ( input , context ) : any => { return { ... ( input . DataSetArn !== undefined && input . DataSetArn !== null && { DataSetArn : input . DataSetArn } ) , ... ( input . DataSetPlaceholder !== undefined && input . DataSetPlaceholder !== null && { DataSetPlaceholder : input . DataSetPlaceholder } ) , } ; } ; const serializeAws_restJson1DataSetReferenceList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DataSetReference ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DataSetUsageConfiguration = ( input , context ) : any => { return { ... ( input . DisableUseAsDirectQuerySource !== undefined && input . DisableUseAsDirectQuerySource !== null && { DisableUseAsDirectQuerySource : input . DisableUseAsDirectQuerySource , } ) , ... ( input . DisableUseAsImportedSource !== undefined && input . DisableUseAsImportedSource !== null && { DisableUseAsImportedSource : input . DisableUseAsImportedSource } ) , } ; } ; const serializeAws_restJson1DataSourceCredentials = ( input , context ) : any => { return { ... ( input . CopySourceArn !== undefined && input . CopySourceArn !== null && { CopySourceArn : input . CopySourceArn } ) , ... ( input . CredentialPair !== undefined && input . CredentialPair !== null && { CredentialPair : serializeAws_restJson1CredentialPair ( input . CredentialPair , context ) , } ) , } ; } ; const serializeAws_restJson1DataSourceParameters = ( input , context ) : any => { return DataSourceParameters . visit ( input , { AmazonElasticsearchParameters : ( value ) => ( { AmazonElasticsearchParameters : serializeAws_restJson1AmazonElasticsearchParameters ( value , context ) , } ) , AmazonOpenSearchParameters : ( value ) => ( { AmazonOpenSearchParameters : serializeAws_restJson1AmazonOpenSearchParameters ( value , context ) , } ) , AthenaParameters : ( value ) => ( { AthenaParameters : serializeAws_restJson1AthenaParameters ( value , context ) } ) , AuroraParameters : ( value ) => ( { AuroraParameters : serializeAws_restJson1AuroraParameters ( value , context ) } ) , AuroraPostgreSqlParameters : ( value ) => ( { AuroraPostgreSqlParameters : serializeAws_restJson1AuroraPostgreSqlParameters ( value , context ) , } ) , AwsIotAnalyticsParameters : ( value ) => ( { AwsIotAnalyticsParameters : serializeAws_restJson1AwsIotAnalyticsParameters ( value , context ) , } ) , ExasolParameters : ( value ) => ( { ExasolParameters : serializeAws_restJson1ExasolParameters ( value , context ) } ) , JiraParameters : ( value ) => ( { JiraParameters : serializeAws_restJson1JiraParameters ( value , context ) } ) , MariaDbParameters : ( value ) => ( { MariaDbParameters : serializeAws_restJson1MariaDbParameters ( value , context ) } ) , MySqlParameters : ( value ) => ( { MySqlParameters : serializeAws_restJson1MySqlParameters ( value , context ) } ) , OracleParameters : ( value ) => ( { OracleParameters : serializeAws_restJson1OracleParameters ( value , context ) } ) , PostgreSqlParameters : ( value ) => ( { PostgreSqlParameters : serializeAws_restJson1PostgreSqlParameters ( value , context ) , } ) , PrestoParameters : ( value ) => ( { PrestoParameters : serializeAws_restJson1PrestoParameters ( value , context ) } ) , RdsParameters : ( value ) => ( { RdsParameters : serializeAws_restJson1RdsParameters ( value , context ) } ) , RedshiftParameters : ( value ) => ( { RedshiftParameters : serializeAws_restJson1RedshiftParameters ( value , context ) } ) , S3Parameters : ( value ) => ( { S3Parameters : serializeAws_restJson1S3Parameters ( value , context ) } ) , ServiceNowParameters : ( value ) => ( { ServiceNowParameters : serializeAws_restJson1ServiceNowParameters ( value , context ) , } ) , SnowflakeParameters : ( value ) => ( { SnowflakeParameters : serializeAws_restJson1SnowflakeParameters ( value , context ) , } ) , SparkParameters : ( value ) => ( { SparkParameters : serializeAws_restJson1SparkParameters ( value , context ) } ) , SqlServerParameters : ( value ) => ( { SqlServerParameters : serializeAws_restJson1SqlServerParameters ( value , context ) , } ) , TeradataParameters : ( value ) => ( { TeradataParameters : serializeAws_restJson1TeradataParameters ( value , context ) } ) , TwitterParameters : ( value ) => ( { TwitterParameters : serializeAws_restJson1TwitterParameters ( value , context ) } ) , _ : ( name , value ) => ( { name : value } as any ) , } ) ; } ; const serializeAws_restJson1DataSourceParametersList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DataSourceParameters ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DateTimeParameter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_restJson1TimestampList ( input . Values , context ) } ) , } ; } ; const serializeAws_restJson1DateTimeParameterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DateTimeParameter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DecimalParameter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_restJson1DoubleList ( input . Values , context ) } ) , } ; } ; const serializeAws_restJson1DecimalParameterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1DecimalParameter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1DoubleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __serializeFloat ( entry ) ; } ) ; } ; const serializeAws_restJson1ExasolParameters = ( input , context ) : any => { return { ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1ExportToCSVOption = ( input , context ) : any => { return { ... ( input . AvailabilityStatus !== undefined && input . AvailabilityStatus !== null && { AvailabilityStatus : input . AvailabilityStatus } ) , } ; } ; const serializeAws_restJson1FieldFolder = ( input , context ) : any => { return { ... ( input . columns !== undefined && input . columns !== null && { columns : serializeAws_restJson1FolderColumnList ( input . columns , context ) } ) , ... ( input . description !== undefined && input . description !== null && { description : input . description } ) , } ; } ; const serializeAws_restJson1FieldFolderMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_restJson1FieldFolder ( value , context ) , } ; } , { } ) ; } ; const serializeAws_restJson1FilterOperation = ( input , context ) : any => { return { ... ( input . ConditionExpression !== undefined && input . ConditionExpression !== null && { ConditionExpression : input . ConditionExpression } ) , } ; } ; const serializeAws_restJson1FolderColumnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1FolderSearchFilter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Operator !== undefined && input . Operator !== null && { Operator : input . Operator } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_restJson1FolderSearchFilterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1FolderSearchFilter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1GeoSpatialColumnGroup = ( input , context ) : any => { return { ... ( input . Columns !== undefined && input . Columns !== null && { Columns : serializeAws_restJson1ColumnList ( input . Columns , context ) } ) , ... ( input . CountryCode !== undefined && input . CountryCode !== null && { CountryCode : input . CountryCode } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , } ; } ; const serializeAws_restJson1GutterStyle = ( input , context ) : any => { return { ... ( input . Show !== undefined && input . Show !== null && { Show : input . Show } ) , } ; } ; const serializeAws_restJson1IdentityMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_restJson1IdentityNameList ( value , context ) , } ; } , { } ) ; } ; const serializeAws_restJson1IdentityNameList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1InputColumn = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_restJson1InputColumnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1InputColumn ( entry , context ) ; } ) ; } ; const serializeAws_restJson1IntegerParameter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_restJson1LongList ( input . Values , context ) } ) , } ; } ; const serializeAws_restJson1IntegerParameterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1IntegerParameter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1IpRestrictionRuleMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : value , } ; } , { } ) ; } ; const serializeAws_restJson1JiraParameters = ( input , context ) : any => { return { ... ( input . SiteBaseUrl !== undefined && input . SiteBaseUrl !== null && { SiteBaseUrl : input . SiteBaseUrl } ) , } ; } ; const serializeAws_restJson1JoinInstruction = ( input , context ) : any => { return { ... ( input . LeftJoinKeyProperties !== undefined && input . LeftJoinKeyProperties !== null && { LeftJoinKeyProperties : serializeAws_restJson1JoinKeyProperties ( input . LeftJoinKeyProperties , context ) , } ) , ... ( input . LeftOperand !== undefined && input . LeftOperand !== null && { LeftOperand : input . LeftOperand } ) , ... ( input . OnClause !== undefined && input . OnClause !== null && { OnClause : input . OnClause } ) , ... ( input . RightJoinKeyProperties !== undefined && input . RightJoinKeyProperties !== null && { RightJoinKeyProperties : serializeAws_restJson1JoinKeyProperties ( input . RightJoinKeyProperties , context ) , } ) , ... ( input . RightOperand !== undefined && input . RightOperand !== null && { RightOperand : input . RightOperand } ) , ... ( input . Type !== undefined && input . Type !== null && { Type : input . Type } ) , } ; } ; const serializeAws_restJson1JoinKeyProperties = ( input , context ) : any => { return { ... ( input . UniqueKey !== undefined && input . UniqueKey !== null && { UniqueKey : input . UniqueKey } ) , } ; } ; const serializeAws_restJson1LogicalTable = ( input , context ) : any => { return { ... ( input . Alias !== undefined && input . Alias !== null && { Alias : input . Alias } ) , ... ( input . DataTransforms !== undefined && input . DataTransforms !== null && { DataTransforms : serializeAws_restJson1TransformOperationList ( input . DataTransforms , context ) , } ) , ... ( input . Source !== undefined && input . Source !== null && { Source : serializeAws_restJson1LogicalTableSource ( input . Source , context ) } ) , } ; } ; const serializeAws_restJson1LogicalTableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_restJson1LogicalTable ( value , context ) , } ; } , { } ) ; } ; const serializeAws_restJson1LogicalTableSource = ( input , context ) : any => { return { ... ( input . DataSetArn !== undefined && input . DataSetArn !== null && { DataSetArn : input . DataSetArn } ) , ... ( input . JoinInstruction !== undefined && input . JoinInstruction !== null && { JoinInstruction : serializeAws_restJson1JoinInstruction ( input . JoinInstruction , context ) , } ) , ... ( input . PhysicalTableId !== undefined && input . PhysicalTableId !== null && { PhysicalTableId : input . PhysicalTableId } ) , } ; } ; const serializeAws_restJson1LongList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ManifestFileLocation = ( input , context ) : any => { return { ... ( input . Bucket !== undefined && input . Bucket !== null && { Bucket : input . Bucket } ) , ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , } ; } ; const serializeAws_restJson1MarginStyle = ( input , context ) : any => { return { ... ( input . Show !== undefined && input . Show !== null && { Show : input . Show } ) , } ; } ; const serializeAws_restJson1MariaDbParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1MySqlParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1OracleParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1_Parameters = ( input , context ) : any => { return { ... ( input . DateTimeParameters !== undefined && input . DateTimeParameters !== null && { DateTimeParameters : serializeAws_restJson1DateTimeParameterList ( input . DateTimeParameters , context ) , } ) , ... ( input . DecimalParameters !== undefined && input . DecimalParameters !== null && { DecimalParameters : serializeAws_restJson1DecimalParameterList ( input . DecimalParameters , context ) , } ) , ... ( input . IntegerParameters !== undefined && input . IntegerParameters !== null && { IntegerParameters : serializeAws_restJson1IntegerParameterList ( input . IntegerParameters , context ) , } ) , ... ( input . StringParameters !== undefined && input . StringParameters !== null && { StringParameters : serializeAws_restJson1StringParameterList ( input . StringParameters , context ) , } ) , } ; } ; const serializeAws_restJson1PhysicalTable = ( input , context ) : any => { return PhysicalTable . visit ( input , { CustomSql : ( value ) => ( { CustomSql : serializeAws_restJson1CustomSql ( value , context ) } ) , RelationalTable : ( value ) => ( { RelationalTable : serializeAws_restJson1RelationalTable ( value , context ) } ) , S3Source : ( value ) => ( { S3Source : serializeAws_restJson1S3Source ( value , context ) } ) , _ : ( name , value ) => ( { name : value } as any ) , } ) ; } ; const serializeAws_restJson1PhysicalTableMap = ( input , context ) : any => { return Object . entries ( input ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : serializeAws_restJson1PhysicalTable ( value , context ) , } ; } , { } ) ; } ; const serializeAws_restJson1PostgreSqlParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1PrestoParameters = ( input , context ) : any => { return { ... ( input . Catalog !== undefined && input . Catalog !== null && { Catalog : input . Catalog } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1PrincipalList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ProjectedColumnList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1ProjectOperation = ( input , context ) : any => { return { ... ( input . ProjectedColumns !== undefined && input . ProjectedColumns !== null && { ProjectedColumns : serializeAws_restJson1ProjectedColumnList ( input . ProjectedColumns , context ) , } ) , } ; } ; const serializeAws_restJson1RdsParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . InstanceId !== undefined && input . InstanceId !== null && { InstanceId : input . InstanceId } ) , } ; } ; const serializeAws_restJson1RedshiftParameters = ( input , context ) : any => { return { ... ( input . ClusterId !== undefined && input . ClusterId !== null && { ClusterId : input . ClusterId } ) , ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1RegisteredUserDashboardEmbeddingConfiguration = ( input , context ) : any => { return { ... ( input . InitialDashboardId !== undefined && input . InitialDashboardId !== null && { InitialDashboardId : input . InitialDashboardId } ) , } ; } ; const serializeAws_restJson1RegisteredUserEmbeddingExperienceConfiguration = ( input , context ) : any => { return { ... ( input . Dashboard !== undefined && input . Dashboard !== null && { Dashboard : serializeAws_restJson1RegisteredUserDashboardEmbeddingConfiguration ( input . Dashboard , context ) , } ) , ... ( input . QSearchBar !== undefined && input . QSearchBar !== null && { QSearchBar : serializeAws_restJson1RegisteredUserQSearchBarEmbeddingConfiguration ( input . QSearchBar , context ) , } ) , ... ( input . QuickSightConsole !== undefined && input . QuickSightConsole !== null && { QuickSightConsole : serializeAws_restJson1RegisteredUserQuickSightConsoleEmbeddingConfiguration ( input . QuickSightConsole , context ) , } ) , } ; } ; const serializeAws_restJson1RegisteredUserQSearchBarEmbeddingConfiguration = ( input , context ) : any => { return { ... ( input . InitialTopicId !== undefined && input . InitialTopicId !== null && { InitialTopicId : input . InitialTopicId } ) , } ; } ; const serializeAws_restJson1RegisteredUserQuickSightConsoleEmbeddingConfiguration = ( input , context ) : any => { return { ... ( input . InitialPath !== undefined && input . InitialPath !== null && { InitialPath : input . InitialPath } ) , } ; } ; const serializeAws_restJson1RelationalTable = ( input , context ) : any => { return { ... ( input . Catalog !== undefined && input . Catalog !== null && { Catalog : input . Catalog } ) , ... ( input . DataSourceArn !== undefined && input . DataSourceArn !== null && { DataSourceArn : input . DataSourceArn } ) , ... ( input . InputColumns !== undefined && input . InputColumns !== null && { InputColumns : serializeAws_restJson1InputColumnList ( input . InputColumns , context ) , } ) , ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Schema !== undefined && input . Schema !== null && { Schema : input . Schema } ) , } ; } ; const serializeAws_restJson1RenameColumnOperation = ( input , context ) : any => { return { ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . NewColumnName !== undefined && input . NewColumnName !== null && { NewColumnName : input . NewColumnName } ) , } ; } ; const serializeAws_restJson1ResourcePermission = ( input , context ) : any => { return { ... ( input . Actions !== undefined && input . Actions !== null && { Actions : serializeAws_restJson1ActionList ( input . Actions , context ) } ) , ... ( input . Principal !== undefined && input . Principal !== null && { Principal : input . Principal } ) , } ; } ; const serializeAws_restJson1ResourcePermissionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ResourcePermission ( entry , context ) ; } ) ; } ; const serializeAws_restJson1RowLevelPermissionDataSet = ( input , context ) : any => { return { ... ( input . Arn !== undefined && input . Arn !== null && { Arn : input . Arn } ) , ... ( input . FormatVersion !== undefined && input . FormatVersion !== null && { FormatVersion : input . FormatVersion } ) , ... ( input . Namespace !== undefined && input . Namespace !== null && { Namespace : input . Namespace } ) , ... ( input . PermissionPolicy !== undefined && input . PermissionPolicy !== null && { PermissionPolicy : input . PermissionPolicy } ) , ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , } ; } ; const serializeAws_restJson1RowLevelPermissionTagConfiguration = ( input , context ) : any => { return { ... ( input . Status !== undefined && input . Status !== null && { Status : input . Status } ) , ... ( input . TagRules !== undefined && input . TagRules !== null && { TagRules : serializeAws_restJson1RowLevelPermissionTagRuleList ( input . TagRules , context ) , } ) , } ; } ; const serializeAws_restJson1RowLevelPermissionTagRule = ( input , context ) : any => { return { ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . MatchAllValue !== undefined && input . MatchAllValue !== null && { MatchAllValue : input . MatchAllValue } ) , ... ( input . TagKey !== undefined && input . TagKey !== null && { TagKey : input . TagKey } ) , ... ( input . TagMultiValueDelimiter !== undefined && input . TagMultiValueDelimiter !== null && { TagMultiValueDelimiter : input . TagMultiValueDelimiter } ) , } ; } ; const serializeAws_restJson1RowLevelPermissionTagRuleList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1RowLevelPermissionTagRule ( entry , context ) ; } ) ; } ; const serializeAws_restJson1S3Parameters = ( input , context ) : any => { return { ... ( input . ManifestFileLocation !== undefined && input . ManifestFileLocation !== null && { ManifestFileLocation : serializeAws_restJson1ManifestFileLocation ( input . ManifestFileLocation , context ) , } ) , } ; } ; const serializeAws_restJson1S3Source = ( input , context ) : any => { return { ... ( input . DataSourceArn !== undefined && input . DataSourceArn !== null && { DataSourceArn : input . DataSourceArn } ) , ... ( input . InputColumns !== undefined && input . InputColumns !== null && { InputColumns : serializeAws_restJson1InputColumnList ( input . InputColumns , context ) , } ) , ... ( input . UploadSettings !== undefined && input . UploadSettings !== null && { UploadSettings : serializeAws_restJson1UploadSettings ( input . UploadSettings , context ) , } ) , } ; } ; const serializeAws_restJson1ServiceNowParameters = ( input , context ) : any => { return { ... ( input . SiteBaseUrl !== undefined && input . SiteBaseUrl !== null && { SiteBaseUrl : input . SiteBaseUrl } ) , } ; } ; const serializeAws_restJson1SessionTag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_restJson1SessionTagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1SessionTag ( entry , context ) ; } ) ; } ; const serializeAws_restJson1SheetControlsOption = ( input , context ) : any => { return { ... ( input . VisibilityState !== undefined && input . VisibilityState !== null && { VisibilityState : input . VisibilityState } ) , } ; } ; const serializeAws_restJson1SheetStyle = ( input , context ) : any => { return { ... ( input . Tile !== undefined && input . Tile !== null && { Tile : serializeAws_restJson1TileStyle ( input . Tile , context ) } ) , ... ( input . TileLayout !== undefined && input . TileLayout !== null && { TileLayout : serializeAws_restJson1TileLayoutStyle ( input . TileLayout , context ) } ) , } ; } ; const serializeAws_restJson1SnowflakeParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Warehouse !== undefined && input . Warehouse !== null && { Warehouse : input . Warehouse } ) , } ; } ; const serializeAws_restJson1SparkParameters = ( input , context ) : any => { return { ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1SqlServerParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1SslProperties = ( input , context ) : any => { return { ... ( input . DisableSsl !== undefined && input . DisableSsl !== null && { DisableSsl : input . DisableSsl } ) , } ; } ; const serializeAws_restJson1StringList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return entry ; } ) ; } ; const serializeAws_restJson1StringParameter = ( input , context ) : any => { return { ... ( input . Name !== undefined && input . Name !== null && { Name : input . Name } ) , ... ( input . Values !== undefined && input . Values !== null && { Values : serializeAws_restJson1StringList ( input . Values , context ) } ) , } ; } ; const serializeAws_restJson1StringParameterList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1StringParameter ( entry , context ) ; } ) ; } ; const serializeAws_restJson1Tag = ( input , context ) : any => { return { ... ( input . Key !== undefined && input . Key !== null && { Key : input . Key } ) , ... ( input . Value !== undefined && input . Value !== null && { Value : input . Value } ) , } ; } ; const serializeAws_restJson1TagColumnOperation = ( input , context ) : any => { return { ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . Tags !== undefined && input . Tags !== null && { Tags : serializeAws_restJson1ColumnTagList ( input . Tags , context ) } ) , } ; } ; const serializeAws_restJson1TagList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1Tag ( entry , context ) ; } ) ; } ; const serializeAws_restJson1TemplateSourceAnalysis = ( input , context ) : any => { return { ... ( input . Arn !== undefined && input . Arn !== null && { Arn : input . Arn } ) , ... ( input . DataSetReferences !== undefined && input . DataSetReferences !== null && { DataSetReferences : serializeAws_restJson1DataSetReferenceList ( input . DataSetReferences , context ) , } ) , } ; } ; const serializeAws_restJson1TemplateSourceEntity = ( input , context ) : any => { return { ... ( input . SourceAnalysis !== undefined && input . SourceAnalysis !== null && { SourceAnalysis : serializeAws_restJson1TemplateSourceAnalysis ( input . SourceAnalysis , context ) , } ) , ... ( input . SourceTemplate !== undefined && input . SourceTemplate !== null && { SourceTemplate : serializeAws_restJson1TemplateSourceTemplate ( input . SourceTemplate , context ) , } ) , } ; } ; const serializeAws_restJson1TemplateSourceTemplate = ( input , context ) : any => { return { ... ( input . Arn !== undefined && input . Arn !== null && { Arn : input . Arn } ) , } ; } ; const serializeAws_restJson1TeradataParameters = ( input , context ) : any => { return { ... ( input . Database !== undefined && input . Database !== null && { Database : input . Database } ) , ... ( input . Host !== undefined && input . Host !== null && { Host : input . Host } ) , ... ( input . Port !== undefined && input . Port !== null && { Port : input . Port } ) , } ; } ; const serializeAws_restJson1ThemeConfiguration = ( input , context ) : any => { return { ... ( input . DataColorPalette !== undefined && input . DataColorPalette !== null && { DataColorPalette : serializeAws_restJson1DataColorPalette ( input . DataColorPalette , context ) , } ) , ... ( input . Sheet !== undefined && input . Sheet !== null && { Sheet : serializeAws_restJson1SheetStyle ( input . Sheet , context ) } ) , ... ( input . UIColorPalette !== undefined && input . UIColorPalette !== null && { UIColorPalette : serializeAws_restJson1UIColorPalette ( input . UIColorPalette , context ) , } ) , } ; } ; const serializeAws_restJson1TileLayoutStyle = ( input , context ) : any => { return { ... ( input . Gutter !== undefined && input . Gutter !== null && { Gutter : serializeAws_restJson1GutterStyle ( input . Gutter , context ) } ) , ... ( input . Margin !== undefined && input . Margin !== null && { Margin : serializeAws_restJson1MarginStyle ( input . Margin , context ) } ) , } ; } ; const serializeAws_restJson1TileStyle = ( input , context ) : any => { return { ... ( input . Border !== undefined && input . Border !== null && { Border : serializeAws_restJson1BorderStyle ( input . Border , context ) } ) , } ; } ; const serializeAws_restJson1TimestampList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return Math . round ( entry . getTime ( ) / 1000 ) ; } ) ; } ; const serializeAws_restJson1TransformOperation = ( input , context ) : any => { return TransformOperation . visit ( input , { CastColumnTypeOperation : ( value ) => ( { CastColumnTypeOperation : serializeAws_restJson1CastColumnTypeOperation ( value , context ) , } ) , CreateColumnsOperation : ( value ) => ( { CreateColumnsOperation : serializeAws_restJson1CreateColumnsOperation ( value , context ) , } ) , FilterOperation : ( value ) => ( { FilterOperation : serializeAws_restJson1FilterOperation ( value , context ) } ) , ProjectOperation : ( value ) => ( { ProjectOperation : serializeAws_restJson1ProjectOperation ( value , context ) } ) , RenameColumnOperation : ( value ) => ( { RenameColumnOperation : serializeAws_restJson1RenameColumnOperation ( value , context ) , } ) , TagColumnOperation : ( value ) => ( { TagColumnOperation : serializeAws_restJson1TagColumnOperation ( value , context ) } ) , UntagColumnOperation : ( value ) => ( { UntagColumnOperation : serializeAws_restJson1UntagColumnOperation ( value , context ) , } ) , _ : ( name , value ) => ( { name : value } as any ) , } ) ; } ; const serializeAws_restJson1TransformOperationList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1TransformOperation ( entry , context ) ; } ) ; } ; const serializeAws_restJson1TwitterParameters = ( input , context ) : any => { return { ... ( input . MaxRows !== undefined && input . MaxRows !== null && { MaxRows : input . MaxRows } ) , ... ( input . Query !== undefined && input . Query !== null && { Query : input . Query } ) , } ; } ; const serializeAws_restJson1UIColorPalette = ( input , context ) : any => { return { ... ( input . Accent !== undefined && input . Accent !== null && { Accent : input . Accent } ) , ... ( input . AccentForeground !== undefined && input . AccentForeground !== null && { AccentForeground : input . AccentForeground } ) , ... ( input . Danger !== undefined && input . Danger !== null && { Danger : input . Danger } ) , ... ( input . DangerForeground !== undefined && input . DangerForeground !== null && { DangerForeground : input . DangerForeground } ) , ... ( input . Dimension !== undefined && input . Dimension !== null && { Dimension : input . Dimension } ) , ... ( input . DimensionForeground !== undefined && input . DimensionForeground !== null && { DimensionForeground : input . DimensionForeground } ) , ... ( input . Measure !== undefined && input . Measure !== null && { Measure : input . Measure } ) , ... ( input . MeasureForeground !== undefined && input . MeasureForeground !== null && { MeasureForeground : input . MeasureForeground } ) , ... ( input . PrimaryBackground !== undefined && input . PrimaryBackground !== null && { PrimaryBackground : input . PrimaryBackground } ) , ... ( input . PrimaryForeground !== undefined && input . PrimaryForeground !== null && { PrimaryForeground : input . PrimaryForeground } ) , ... ( input . SecondaryBackground !== undefined && input . SecondaryBackground !== null && { SecondaryBackground : input . SecondaryBackground } ) , ... ( input . SecondaryForeground !== undefined && input . SecondaryForeground !== null && { SecondaryForeground : input . SecondaryForeground } ) , ... ( input . Success !== undefined && input . Success !== null && { Success : input . Success } ) , ... ( input . SuccessForeground !== undefined && input . SuccessForeground !== null && { SuccessForeground : input . SuccessForeground } ) , ... ( input . Warning !== undefined && input . Warning !== null && { Warning : input . Warning } ) , ... ( input . WarningForeground !== undefined && input . WarningForeground !== null && { WarningForeground : input . WarningForeground } ) , } ; } ; const serializeAws_restJson1UntagColumnOperation = ( input , context ) : any => { return { ... ( input . ColumnName !== undefined && input . ColumnName !== null && { ColumnName : input . ColumnName } ) , ... ( input . TagNames !== undefined && input . TagNames !== null && { TagNames : serializeAws_restJson1ColumnTagNames ( input . TagNames , context ) } ) , } ; } ; const serializeAws_restJson1UpdateLinkPermissionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ResourcePermission ( entry , context ) ; } ) ; } ; const serializeAws_restJson1UpdateResourcePermissionList = ( input , context ) : any => { return input . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return serializeAws_restJson1ResourcePermission ( entry , context ) ; } ) ; } ; const serializeAws_restJson1UploadSettings = ( input , context ) : any => { return { ... ( input . ContainsHeader !== undefined && input . ContainsHeader !== null && { ContainsHeader : input . ContainsHeader } ) , ... ( input . Delimiter !== undefined && input . Delimiter !== null && { Delimiter : input . Delimiter } ) , ... ( input . Format !== undefined && input . Format !== null && { Format : input . Format } ) , ... ( input . StartFromRow !== undefined && input . StartFromRow !== null && { StartFromRow : input . StartFromRow } ) , ... ( input . TextQualifier !== undefined && input . TextQualifier !== null && { TextQualifier : input . TextQualifier } ) , } ; } ; const serializeAws_restJson1VpcConnectionProperties = ( input , context ) : any => { return { ... ( input . VpcConnectionArn !== undefined && input . VpcConnectionArn !== null && { VpcConnectionArn : input . VpcConnectionArn } ) , } ; } ; const deserializeAws_restJson1AccountCustomization = ( output , context ) : AccountCustomization => { return { DefaultEmailCustomizationTemplate : __expectString ( output . DefaultEmailCustomizationTemplate ) , DefaultTheme : __expectString ( output . DefaultTheme ) , } as any ; } ; const deserializeAws_restJson1AccountSettings = ( output , context ) : AccountSettings => { return { AccountName : __expectString ( output . AccountName ) , DefaultNamespace : __expectString ( output . DefaultNamespace ) , Edition : __expectString ( output . Edition ) , NotificationEmail : __expectString ( output . NotificationEmail ) , } as any ; } ; const deserializeAws_restJson1ActionList = ( 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_restJson1ActiveIAMPolicyAssignment = ( output , context ) : ActiveIAMPolicyAssignment => { return { AssignmentName : __expectString ( output . AssignmentName ) , PolicyArn : __expectString ( output . PolicyArn ) , } as any ; } ; const deserializeAws_restJson1ActiveIAMPolicyAssignmentList = ( output , context ) : ActiveIAMPolicyAssignment [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ActiveIAMPolicyAssignment ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1AmazonElasticsearchParameters = ( output , context ) : AmazonElasticsearchParameters => { return { Domain : __expectString ( output . Domain ) , } as any ; } ; const deserializeAws_restJson1AmazonOpenSearchParameters = ( output , context ) : AmazonOpenSearchParameters => { return { Domain : __expectString ( output . Domain ) , } as any ; } ; const deserializeAws_restJson1Analysis = ( output , context ) : Analysis => { return { AnalysisId : __expectString ( output . AnalysisId ) , Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSetArns : output . DataSetArns !== undefined && output . DataSetArns !== null ? deserializeAws_restJson1DataSetArnsList ( output . DataSetArns , context ) : undefined , Errors : output . Errors !== undefined && output . Errors !== null ? deserializeAws_restJson1AnalysisErrorList ( output . Errors , context ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , Sheets : output . Sheets !== undefined && output . Sheets !== null ? deserializeAws_restJson1SheetList ( output . Sheets , context ) : undefined , Status : __expectString ( output . Status ) , ThemeArn : __expectString ( output . ThemeArn ) , } as any ; } ; const deserializeAws_restJson1AnalysisError = ( output , context ) : AnalysisError => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1AnalysisErrorList = ( output , context ) : AnalysisError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1AnalysisError ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1AnalysisSummary = ( output , context ) : AnalysisSummary => { return { AnalysisId : __expectString ( output . AnalysisId ) , Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_restJson1AnalysisSummaryList = ( output , context ) : AnalysisSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1AnalysisSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1AthenaParameters = ( output , context ) : AthenaParameters => { return { WorkGroup : __expectString ( output . WorkGroup ) , } as any ; } ; const deserializeAws_restJson1AuroraParameters = ( output , context ) : AuroraParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1AuroraPostgreSqlParameters = ( output , context ) : AuroraPostgreSqlParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1AwsIotAnalyticsParameters = ( output , context ) : AwsIotAnalyticsParameters => { return { DataSetName : __expectString ( output . DataSetName ) , } as any ; } ; const deserializeAws_restJson1BorderStyle = ( output , context ) : BorderStyle => { return { Show : __expectBoolean ( output . Show ) , } as any ; } ; const deserializeAws_restJson1CalculatedColumn = ( output , context ) : CalculatedColumn => { return { ColumnId : __expectString ( output . ColumnId ) , ColumnName : __expectString ( output . ColumnName ) , Expression : __expectString ( output . Expression ) , } as any ; } ; const deserializeAws_restJson1CalculatedColumnList = ( output , context ) : CalculatedColumn [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1CalculatedColumn ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1CastColumnTypeOperation = ( output , context ) : CastColumnTypeOperation => { return { ColumnName : __expectString ( output . ColumnName ) , Format : __expectString ( output . Format ) , NewColumnType : __expectString ( output . NewColumnType ) , } as any ; } ; const deserializeAws_restJson1ColorList = ( 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_restJson1ColumnDescription = ( output , context ) : ColumnDescription => { return { Text : __expectString ( output . Text ) , } as any ; } ; const deserializeAws_restJson1ColumnGroup = ( output , context ) : ColumnGroup => { return { GeoSpatialColumnGroup : output . GeoSpatialColumnGroup !== undefined && output . GeoSpatialColumnGroup !== null ? deserializeAws_restJson1GeoSpatialColumnGroup ( output . GeoSpatialColumnGroup , context ) : undefined , } as any ; } ; const deserializeAws_restJson1ColumnGroupColumnSchema = ( output , context ) : ColumnGroupColumnSchema => { return { Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1ColumnGroupColumnSchemaList = ( output , context ) : ColumnGroupColumnSchema [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnGroupColumnSchema ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnGroupList = ( output , context ) : ColumnGroup [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnGroup ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnGroupSchema = ( output , context ) : ColumnGroupSchema => { return { ColumnGroupColumnSchemaList : output . ColumnGroupColumnSchemaList !== undefined && output . ColumnGroupColumnSchemaList !== null ? deserializeAws_restJson1ColumnGroupColumnSchemaList ( output . ColumnGroupColumnSchemaList , context ) : undefined , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1ColumnGroupSchemaList = ( output , context ) : ColumnGroupSchema [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnGroupSchema ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnLevelPermissionRule = ( output , context ) : ColumnLevelPermissionRule => { return { ColumnNames : output . ColumnNames !== undefined && output . ColumnNames !== null ? deserializeAws_restJson1ColumnNameList ( output . ColumnNames , context ) : undefined , Principals : output . Principals !== undefined && output . Principals !== null ? deserializeAws_restJson1PrincipalList ( output . Principals , context ) : undefined , } as any ; } ; const deserializeAws_restJson1ColumnLevelPermissionRuleList = ( output , context ) : ColumnLevelPermissionRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnLevelPermissionRule ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnList = ( 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_restJson1ColumnNameList = ( 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_restJson1ColumnSchema = ( output , context ) : ColumnSchema => { return { DataType : __expectString ( output . DataType ) , GeographicRole : __expectString ( output . GeographicRole ) , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1ColumnSchemaList = ( output , context ) : ColumnSchema [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnSchema ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnTag = ( output , context ) : ColumnTag => { return { ColumnDescription : output . ColumnDescription !== undefined && output . ColumnDescription !== null ? deserializeAws_restJson1ColumnDescription ( output . ColumnDescription , context ) : undefined , ColumnGeographicRole : __expectString ( output . ColumnGeographicRole ) , } as any ; } ; const deserializeAws_restJson1ColumnTagList = ( output , context ) : ColumnTag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ColumnTag ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ColumnTagNames = ( output , context ) : ( ColumnTagName | string ) [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return __expectString ( entry ) as any ; } ) ; } ; const deserializeAws_restJson1CreateColumnsOperation = ( output , context ) : CreateColumnsOperation => { return { Columns : output . Columns !== undefined && output . Columns !== null ? deserializeAws_restJson1CalculatedColumnList ( output . Columns , context ) : undefined , } as any ; } ; const deserializeAws_restJson1CustomSql = ( output , context ) : CustomSql => { return { Columns : output . Columns !== undefined && output . Columns !== null ? deserializeAws_restJson1InputColumnList ( output . Columns , context ) : undefined , DataSourceArn : __expectString ( output . DataSourceArn ) , Name : __expectString ( output . Name ) , SqlQuery : __expectString ( output . SqlQuery ) , } as any ; } ; const deserializeAws_restJson1Dashboard = ( output , context ) : Dashboard => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DashboardId : __expectString ( output . DashboardId ) , LastPublishedTime : output . LastPublishedTime !== undefined && output . LastPublishedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastPublishedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , Version : output . Version !== undefined && output . Version !== null ? deserializeAws_restJson1DashboardVersion ( output . Version , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DashboardError = ( output , context ) : DashboardError => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1DashboardErrorList = ( output , context ) : DashboardError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DashboardError ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DashboardSummary = ( output , context ) : DashboardSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DashboardId : __expectString ( output . DashboardId ) , LastPublishedTime : output . LastPublishedTime !== undefined && output . LastPublishedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastPublishedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , PublishedVersionNumber : __expectLong ( output . PublishedVersionNumber ) , } as any ; } ; const deserializeAws_restJson1DashboardSummaryList = ( output , context ) : DashboardSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DashboardSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DashboardVersion = ( output , context ) : DashboardVersion => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSetArns : output . DataSetArns !== undefined && output . DataSetArns !== null ? deserializeAws_restJson1DataSetArnsList ( output . DataSetArns , context ) : undefined , Description : __expectString ( output . Description ) , Errors : output . Errors !== undefined && output . Errors !== null ? deserializeAws_restJson1DashboardErrorList ( output . Errors , context ) : undefined , Sheets : output . Sheets !== undefined && output . Sheets !== null ? deserializeAws_restJson1SheetList ( output . Sheets , context ) : undefined , SourceEntityArn : __expectString ( output . SourceEntityArn ) , Status : __expectString ( output . Status ) , ThemeArn : __expectString ( output . ThemeArn ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1DashboardVersionSummary = ( output , context ) : DashboardVersionSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , Description : __expectString ( output . Description ) , SourceEntityArn : __expectString ( output . SourceEntityArn ) , Status : __expectString ( output . Status ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1DashboardVersionSummaryList = ( output , context ) : DashboardVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DashboardVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataColorPalette = ( output , context ) : DataColorPalette => { return { Colors : output . Colors !== undefined && output . Colors !== null ? deserializeAws_restJson1ColorList ( output . Colors , context ) : undefined , EmptyFillColor : __expectString ( output . EmptyFillColor ) , MinMaxGradient : output . MinMaxGradient !== undefined && output . MinMaxGradient !== null ? deserializeAws_restJson1ColorList ( output . MinMaxGradient , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DataSet = ( output , context ) : DataSet => { return { Arn : __expectString ( output . Arn ) , ColumnGroups : output . ColumnGroups !== undefined && output . ColumnGroups !== null ? deserializeAws_restJson1ColumnGroupList ( output . ColumnGroups , context ) : undefined , ColumnLevelPermissionRules : output . ColumnLevelPermissionRules !== undefined && output . ColumnLevelPermissionRules !== null ? deserializeAws_restJson1ColumnLevelPermissionRuleList ( output . ColumnLevelPermissionRules , context ) : undefined , ConsumedSpiceCapacityInBytes : __expectLong ( output . ConsumedSpiceCapacityInBytes ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSetId : __expectString ( output . DataSetId ) , DataSetUsageConfiguration : output . DataSetUsageConfiguration !== undefined && output . DataSetUsageConfiguration !== null ? deserializeAws_restJson1DataSetUsageConfiguration ( output . DataSetUsageConfiguration , context ) : undefined , FieldFolders : output . FieldFolders !== undefined && output . FieldFolders !== null ? deserializeAws_restJson1FieldFolderMap ( output . FieldFolders , context ) : undefined , ImportMode : __expectString ( output . ImportMode ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , LogicalTableMap : output . LogicalTableMap !== undefined && output . LogicalTableMap !== null ? deserializeAws_restJson1LogicalTableMap ( output . LogicalTableMap , context ) : undefined , Name : __expectString ( output . Name ) , OutputColumns : output . OutputColumns !== undefined && output . OutputColumns !== null ? deserializeAws_restJson1OutputColumnList ( output . OutputColumns , context ) : undefined , PhysicalTableMap : output . PhysicalTableMap !== undefined && output . PhysicalTableMap !== null ? deserializeAws_restJson1PhysicalTableMap ( output . PhysicalTableMap , context ) : undefined , RowLevelPermissionDataSet : output . RowLevelPermissionDataSet !== undefined && output . RowLevelPermissionDataSet !== null ? deserializeAws_restJson1RowLevelPermissionDataSet ( output . RowLevelPermissionDataSet , context ) : undefined , RowLevelPermissionTagConfiguration : output . RowLevelPermissionTagConfiguration !== undefined && output . RowLevelPermissionTagConfiguration !== null ? deserializeAws_restJson1RowLevelPermissionTagConfiguration ( output . RowLevelPermissionTagConfiguration , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DataSetArnsList = ( 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_restJson1DataSetConfiguration = ( output , context ) : DataSetConfiguration => { return { ColumnGroupSchemaList : output . ColumnGroupSchemaList !== undefined && output . ColumnGroupSchemaList !== null ? deserializeAws_restJson1ColumnGroupSchemaList ( output . ColumnGroupSchemaList , context ) : undefined , DataSetSchema : output . DataSetSchema !== undefined && output . DataSetSchema !== null ? deserializeAws_restJson1DataSetSchema ( output . DataSetSchema , context ) : undefined , Placeholder : __expectString ( output . Placeholder ) , } as any ; } ; const deserializeAws_restJson1DataSetConfigurationList = ( output , context ) : DataSetConfiguration [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSetConfiguration ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataSetSchema = ( output , context ) : DataSetSchema => { return { ColumnSchemaList : output . ColumnSchemaList !== undefined && output . ColumnSchemaList !== null ? deserializeAws_restJson1ColumnSchemaList ( output . ColumnSchemaList , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DataSetSummary = ( output , context ) : DataSetSummary => { return { Arn : __expectString ( output . Arn ) , ColumnLevelPermissionRulesApplied : __expectBoolean ( output . ColumnLevelPermissionRulesApplied ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSetId : __expectString ( output . DataSetId ) , ImportMode : __expectString ( output . ImportMode ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , RowLevelPermissionDataSet : output . RowLevelPermissionDataSet !== undefined && output . RowLevelPermissionDataSet !== null ? deserializeAws_restJson1RowLevelPermissionDataSet ( output . RowLevelPermissionDataSet , context ) : undefined , RowLevelPermissionTagConfigurationApplied : __expectBoolean ( output . RowLevelPermissionTagConfigurationApplied ) , } as any ; } ; const deserializeAws_restJson1DataSetSummaryList = ( output , context ) : DataSetSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSetSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataSetUsageConfiguration = ( output , context ) : DataSetUsageConfiguration => { return { DisableUseAsDirectQuerySource : __expectBoolean ( output . DisableUseAsDirectQuerySource ) , DisableUseAsImportedSource : __expectBoolean ( output . DisableUseAsImportedSource ) , } as any ; } ; const deserializeAws_restJson1DataSource = ( output , context ) : DataSource => { return { AlternateDataSourceParameters : output . AlternateDataSourceParameters !== undefined && output . AlternateDataSourceParameters !== null ? deserializeAws_restJson1DataSourceParametersList ( output . AlternateDataSourceParameters , context ) : undefined , Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSourceId : __expectString ( output . DataSourceId ) , DataSourceParameters : output . DataSourceParameters !== undefined && output . DataSourceParameters !== null ? deserializeAws_restJson1DataSourceParameters ( __expectUnion ( output . DataSourceParameters ) , context ) : undefined , ErrorInfo : output . ErrorInfo !== undefined && output . ErrorInfo !== null ? deserializeAws_restJson1DataSourceErrorInfo ( output . ErrorInfo , context ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , SslProperties : output . SslProperties !== undefined && output . SslProperties !== null ? deserializeAws_restJson1SslProperties ( output . SslProperties , context ) : undefined , Status : __expectString ( output . Status ) , Type : __expectString ( output . Type ) , VpcConnectionProperties : output . VpcConnectionProperties !== undefined && output . VpcConnectionProperties !== null ? deserializeAws_restJson1VpcConnectionProperties ( output . VpcConnectionProperties , context ) : undefined , } as any ; } ; const deserializeAws_restJson1DataSourceErrorInfo = ( output , context ) : DataSourceErrorInfo => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1DataSourceList = ( output , context ) : DataSource [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSource ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1DataSourceParameters = ( output , context ) : DataSourceParameters => { if ( output . AmazonElasticsearchParameters !== undefined && output . AmazonElasticsearchParameters !== null ) { return { AmazonElasticsearchParameters : deserializeAws_restJson1AmazonElasticsearchParameters ( output . AmazonElasticsearchParameters , context ) , } ; } if ( output . AmazonOpenSearchParameters !== undefined && output . AmazonOpenSearchParameters !== null ) { return { AmazonOpenSearchParameters : deserializeAws_restJson1AmazonOpenSearchParameters ( output . AmazonOpenSearchParameters , context ) , } ; } if ( output . AthenaParameters !== undefined && output . AthenaParameters !== null ) { return { AthenaParameters : deserializeAws_restJson1AthenaParameters ( output . AthenaParameters , context ) , } ; } if ( output . AuroraParameters !== undefined && output . AuroraParameters !== null ) { return { AuroraParameters : deserializeAws_restJson1AuroraParameters ( output . AuroraParameters , context ) , } ; } if ( output . AuroraPostgreSqlParameters !== undefined && output . AuroraPostgreSqlParameters !== null ) { return { AuroraPostgreSqlParameters : deserializeAws_restJson1AuroraPostgreSqlParameters ( output . AuroraPostgreSqlParameters , context ) , } ; } if ( output . AwsIotAnalyticsParameters !== undefined && output . AwsIotAnalyticsParameters !== null ) { return { AwsIotAnalyticsParameters : deserializeAws_restJson1AwsIotAnalyticsParameters ( output . AwsIotAnalyticsParameters , context ) , } ; } if ( output . ExasolParameters !== undefined && output . ExasolParameters !== null ) { return { ExasolParameters : deserializeAws_restJson1ExasolParameters ( output . ExasolParameters , context ) , } ; } if ( output . JiraParameters !== undefined && output . JiraParameters !== null ) { return { JiraParameters : deserializeAws_restJson1JiraParameters ( output . JiraParameters , context ) , } ; } if ( output . MariaDbParameters !== undefined && output . MariaDbParameters !== null ) { return { MariaDbParameters : deserializeAws_restJson1MariaDbParameters ( output . MariaDbParameters , context ) , } ; } if ( output . MySqlParameters !== undefined && output . MySqlParameters !== null ) { return { MySqlParameters : deserializeAws_restJson1MySqlParameters ( output . MySqlParameters , context ) , } ; } if ( output . OracleParameters !== undefined && output . OracleParameters !== null ) { return { OracleParameters : deserializeAws_restJson1OracleParameters ( output . OracleParameters , context ) , } ; } if ( output . PostgreSqlParameters !== undefined && output . PostgreSqlParameters !== null ) { return { PostgreSqlParameters : deserializeAws_restJson1PostgreSqlParameters ( output . PostgreSqlParameters , context ) , } ; } if ( output . PrestoParameters !== undefined && output . PrestoParameters !== null ) { return { PrestoParameters : deserializeAws_restJson1PrestoParameters ( output . PrestoParameters , context ) , } ; } if ( output . RdsParameters !== undefined && output . RdsParameters !== null ) { return { RdsParameters : deserializeAws_restJson1RdsParameters ( output . RdsParameters , context ) , } ; } if ( output . RedshiftParameters !== undefined && output . RedshiftParameters !== null ) { return { RedshiftParameters : deserializeAws_restJson1RedshiftParameters ( output . RedshiftParameters , context ) , } ; } if ( output . S3Parameters !== undefined && output . S3Parameters !== null ) { return { S3Parameters : deserializeAws_restJson1S3Parameters ( output . S3Parameters , context ) , } ; } if ( output . ServiceNowParameters !== undefined && output . ServiceNowParameters !== null ) { return { ServiceNowParameters : deserializeAws_restJson1ServiceNowParameters ( output . ServiceNowParameters , context ) , } ; } if ( output . SnowflakeParameters !== undefined && output . SnowflakeParameters !== null ) { return { SnowflakeParameters : deserializeAws_restJson1SnowflakeParameters ( output . SnowflakeParameters , context ) , } ; } if ( output . SparkParameters !== undefined && output . SparkParameters !== null ) { return { SparkParameters : deserializeAws_restJson1SparkParameters ( output . SparkParameters , context ) , } ; } if ( output . SqlServerParameters !== undefined && output . SqlServerParameters !== null ) { return { SqlServerParameters : deserializeAws_restJson1SqlServerParameters ( output . SqlServerParameters , context ) , } ; } if ( output . TeradataParameters !== undefined && output . TeradataParameters !== null ) { return { TeradataParameters : deserializeAws_restJson1TeradataParameters ( output . TeradataParameters , context ) , } ; } if ( output . TwitterParameters !== undefined && output . TwitterParameters !== null ) { return { TwitterParameters : deserializeAws_restJson1TwitterParameters ( output . TwitterParameters , context ) , } ; } return { $unknown : Object . entries ( output ) [ 0 ] } ; } ; const deserializeAws_restJson1DataSourceParametersList = ( output , context ) : DataSourceParameters [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1DataSourceParameters ( __expectUnion ( entry ) , context ) ; } ) ; } ; const deserializeAws_restJson1ErrorInfo = ( output , context ) : ErrorInfo => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1ExasolParameters = ( output , context ) : ExasolParameters => { return { Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1FieldFolder = ( output , context ) : FieldFolder => { return { columns : output . columns !== undefined && output . columns !== null ? deserializeAws_restJson1FolderColumnList ( output . columns , context ) : undefined , description : __expectString ( output . description ) , } as any ; } ; const deserializeAws_restJson1FieldFolderMap = ( output , context ) : { [ key ] : FieldFolder ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_restJson1FieldFolder ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_restJson1FilterOperation = ( output , context ) : FilterOperation => { return { ConditionExpression : __expectString ( output . ConditionExpression ) , } as any ; } ; const deserializeAws_restJson1Folder = ( output , context ) : Folder => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , FolderId : __expectString ( output . FolderId ) , FolderPath : output . FolderPath !== undefined && output . FolderPath !== null ? deserializeAws_restJson1Path ( output . FolderPath , context ) : undefined , FolderType : __expectString ( output . FolderType ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1FolderColumnList = ( 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_restJson1FolderMember = ( output , context ) : FolderMember => { return { MemberId : __expectString ( output . MemberId ) , MemberType : __expectString ( output . MemberType ) , } as any ; } ; const deserializeAws_restJson1FolderMemberList = ( output , context ) : MemberIdArnPair [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1MemberIdArnPair ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1FolderSummary = ( output , context ) : FolderSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , FolderId : __expectString ( output . FolderId ) , FolderType : __expectString ( output . FolderType ) , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1FolderSummaryList = ( output , context ) : FolderSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1FolderSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1GeoSpatialColumnGroup = ( output , context ) : GeoSpatialColumnGroup => { return { Columns : output . Columns !== undefined && output . Columns !== null ? deserializeAws_restJson1ColumnList ( output . Columns , context ) : undefined , CountryCode : __expectString ( output . CountryCode ) , Name : __expectString ( output . Name ) , } as any ; } ; const deserializeAws_restJson1Group = ( output , context ) : Group => { return { Arn : __expectString ( output . Arn ) , Description : __expectString ( output . Description ) , GroupName : __expectString ( output . GroupName ) , PrincipalId : __expectString ( output . PrincipalId ) , } as any ; } ; const deserializeAws_restJson1GroupList = ( output , context ) : Group [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Group ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1GroupMember = ( output , context ) : GroupMember => { return { Arn : __expectString ( output . Arn ) , MemberName : __expectString ( output . MemberName ) , } as any ; } ; const deserializeAws_restJson1GroupMemberList = ( output , context ) : GroupMember [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1GroupMember ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1GutterStyle = ( output , context ) : GutterStyle => { return { Show : __expectBoolean ( output . Show ) , } as any ; } ; const deserializeAws_restJson1IAMPolicyAssignment = ( output , context ) : IAMPolicyAssignment => { return { AssignmentId : __expectString ( output . AssignmentId ) , AssignmentName : __expectString ( output . AssignmentName ) , AssignmentStatus : __expectString ( output . AssignmentStatus ) , AwsAccountId : __expectString ( output . AwsAccountId ) , Identities : output . Identities !== undefined && output . Identities !== null ? deserializeAws_restJson1IdentityMap ( output . Identities , context ) : undefined , PolicyArn : __expectString ( output . PolicyArn ) , } as any ; } ; const deserializeAws_restJson1IAMPolicyAssignmentSummary = ( output , context ) : IAMPolicyAssignmentSummary => { return { AssignmentName : __expectString ( output . AssignmentName ) , AssignmentStatus : __expectString ( output . AssignmentStatus ) , } as any ; } ; const deserializeAws_restJson1IAMPolicyAssignmentSummaryList = ( output , context ) : IAMPolicyAssignmentSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1IAMPolicyAssignmentSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1IdentityMap = ( output , context ) : { [ key ] : string [ ] ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_restJson1IdentityNameList ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_restJson1IdentityNameList = ( 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_restJson1Ingestion = ( output , context ) : Ingestion => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , ErrorInfo : output . ErrorInfo !== undefined && output . ErrorInfo !== null ? deserializeAws_restJson1ErrorInfo ( output . ErrorInfo , context ) : undefined , IngestionId : __expectString ( output . IngestionId ) , IngestionSizeInBytes : __expectLong ( output . IngestionSizeInBytes ) , IngestionStatus : __expectString ( output . IngestionStatus ) , IngestionTimeInSeconds : __expectLong ( output . IngestionTimeInSeconds ) , QueueInfo : output . QueueInfo !== undefined && output . QueueInfo !== null ? deserializeAws_restJson1QueueInfo ( output . QueueInfo , context ) : undefined , RequestSource : __expectString ( output . RequestSource ) , RequestType : __expectString ( output . RequestType ) , RowInfo : output . RowInfo !== undefined && output . RowInfo !== null ? deserializeAws_restJson1RowInfo ( output . RowInfo , context ) : undefined , } as any ; } ; const deserializeAws_restJson1Ingestions = ( output , context ) : Ingestion [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Ingestion ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1InputColumn = ( output , context ) : InputColumn => { return { Name : __expectString ( output . Name ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1InputColumnList = ( output , context ) : InputColumn [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1InputColumn ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1IpRestrictionRuleMap = ( output , context ) : { [ key ] : string ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : __expectString ( value ) as any , } ; } , { } ) ; } ; const deserializeAws_restJson1JiraParameters = ( output , context ) : JiraParameters => { return { SiteBaseUrl : __expectString ( output . SiteBaseUrl ) , } as any ; } ; const deserializeAws_restJson1JoinInstruction = ( output , context ) : JoinInstruction => { return { LeftJoinKeyProperties : output . LeftJoinKeyProperties !== undefined && output . LeftJoinKeyProperties !== null ? deserializeAws_restJson1JoinKeyProperties ( output . LeftJoinKeyProperties , context ) : undefined , LeftOperand : __expectString ( output . LeftOperand ) , OnClause : __expectString ( output . OnClause ) , RightJoinKeyProperties : output . RightJoinKeyProperties !== undefined && output . RightJoinKeyProperties !== null ? deserializeAws_restJson1JoinKeyProperties ( output . RightJoinKeyProperties , context ) : undefined , RightOperand : __expectString ( output . RightOperand ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1JoinKeyProperties = ( output , context ) : JoinKeyProperties => { return { UniqueKey : __expectBoolean ( output . UniqueKey ) , } as any ; } ; const deserializeAws_restJson1LinkSharingConfiguration = ( output , context ) : LinkSharingConfiguration => { return { Permissions : output . Permissions !== undefined && output . Permissions !== null ? deserializeAws_restJson1ResourcePermissionList ( output . Permissions , context ) : undefined , } as any ; } ; const deserializeAws_restJson1LogicalTable = ( output , context ) : LogicalTable => { return { Alias : __expectString ( output . Alias ) , DataTransforms : output . DataTransforms !== undefined && output . DataTransforms !== null ? deserializeAws_restJson1TransformOperationList ( output . DataTransforms , context ) : undefined , Source : output . Source !== undefined && output . Source !== null ? deserializeAws_restJson1LogicalTableSource ( output . Source , context ) : undefined , } as any ; } ; const deserializeAws_restJson1LogicalTableMap = ( output , context ) : { [ key ] : LogicalTable ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_restJson1LogicalTable ( value , context ) , } ; } , { } ) ; } ; const deserializeAws_restJson1LogicalTableSource = ( output , context ) : LogicalTableSource => { return { DataSetArn : __expectString ( output . DataSetArn ) , JoinInstruction : output . JoinInstruction !== undefined && output . JoinInstruction !== null ? deserializeAws_restJson1JoinInstruction ( output . JoinInstruction , context ) : undefined , PhysicalTableId : __expectString ( output . PhysicalTableId ) , } as any ; } ; const deserializeAws_restJson1ManifestFileLocation = ( output , context ) : ManifestFileLocation => { return { Bucket : __expectString ( output . Bucket ) , Key : __expectString ( output . Key ) , } as any ; } ; const deserializeAws_restJson1MarginStyle = ( output , context ) : MarginStyle => { return { Show : __expectBoolean ( output . Show ) , } as any ; } ; const deserializeAws_restJson1MariaDbParameters = ( output , context ) : MariaDbParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1MemberIdArnPair = ( output , context ) : MemberIdArnPair => { return { MemberArn : __expectString ( output . MemberArn ) , MemberId : __expectString ( output . MemberId ) , } as any ; } ; const deserializeAws_restJson1MySqlParameters = ( output , context ) : MySqlParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1NamespaceError = ( output , context ) : NamespaceError => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1NamespaceInfoV2 = ( output , context ) : NamespaceInfoV2 => { return { Arn : __expectString ( output . Arn ) , CapacityRegion : __expectString ( output . CapacityRegion ) , CreationStatus : __expectString ( output . CreationStatus ) , IdentityStore : __expectString ( output . IdentityStore ) , Name : __expectString ( output . Name ) , NamespaceError : output . NamespaceError !== undefined && output . NamespaceError !== null ? deserializeAws_restJson1NamespaceError ( output . NamespaceError , context ) : undefined , } as any ; } ; const deserializeAws_restJson1Namespaces = ( output , context ) : NamespaceInfoV2 [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1NamespaceInfoV2 ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1OracleParameters = ( output , context ) : OracleParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1OutputColumn = ( output , context ) : OutputColumn => { return { Description : __expectString ( output . Description ) , Name : __expectString ( output . Name ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1OutputColumnList = ( output , context ) : OutputColumn [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1OutputColumn ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1Path = ( 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_restJson1PhysicalTable = ( output , context ) : PhysicalTable => { if ( output . CustomSql !== undefined && output . CustomSql !== null ) { return { CustomSql : deserializeAws_restJson1CustomSql ( output . CustomSql , context ) , } ; } if ( output . RelationalTable !== undefined && output . RelationalTable !== null ) { return { RelationalTable : deserializeAws_restJson1RelationalTable ( output . RelationalTable , context ) , } ; } if ( output . S3Source !== undefined && output . S3Source !== null ) { return { S3Source : deserializeAws_restJson1S3Source ( output . S3Source , context ) , } ; } return { $unknown : Object . entries ( output ) [ 0 ] } ; } ; const deserializeAws_restJson1PhysicalTableMap = ( output , context ) : { [ key ] : PhysicalTable ; } => { return Object . entries ( output ) . reduce ( ( acc , [ key , value ] ) => { if ( value === null ) { return acc ; } return { ... acc , [ key ] : deserializeAws_restJson1PhysicalTable ( __expectUnion ( value ) , context ) , } ; } , { } ) ; } ; const deserializeAws_restJson1PostgreSqlParameters = ( output , context ) : PostgreSqlParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1PrestoParameters = ( output , context ) : PrestoParameters => { return { Catalog : __expectString ( output . Catalog ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1PrincipalList = ( 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_restJson1ProjectedColumnList = ( 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_restJson1ProjectOperation = ( output , context ) : ProjectOperation => { return { ProjectedColumns : output . ProjectedColumns !== undefined && output . ProjectedColumns !== null ? deserializeAws_restJson1ProjectedColumnList ( output . ProjectedColumns , context ) : undefined , } as any ; } ; const deserializeAws_restJson1QueueInfo = ( output , context ) : QueueInfo => { return { QueuedIngestion : __expectString ( output . QueuedIngestion ) , WaitingOnIngestion : __expectString ( output . WaitingOnIngestion ) , } as any ; } ; const deserializeAws_restJson1RdsParameters = ( output , context ) : RdsParameters => { return { Database : __expectString ( output . Database ) , InstanceId : __expectString ( output . InstanceId ) , } as any ; } ; const deserializeAws_restJson1RedshiftParameters = ( output , context ) : RedshiftParameters => { return { ClusterId : __expectString ( output . ClusterId ) , Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1RelationalTable = ( output , context ) : RelationalTable => { return { Catalog : __expectString ( output . Catalog ) , DataSourceArn : __expectString ( output . DataSourceArn ) , InputColumns : output . InputColumns !== undefined && output . InputColumns !== null ? deserializeAws_restJson1InputColumnList ( output . InputColumns , context ) : undefined , Name : __expectString ( output . Name ) , Schema : __expectString ( output . Schema ) , } as any ; } ; const deserializeAws_restJson1RenameColumnOperation = ( output , context ) : RenameColumnOperation => { return { ColumnName : __expectString ( output . ColumnName ) , NewColumnName : __expectString ( output . NewColumnName ) , } as any ; } ; const deserializeAws_restJson1ResourcePermission = ( output , context ) : ResourcePermission => { return { Actions : output . Actions !== undefined && output . Actions !== null ? deserializeAws_restJson1ActionList ( output . Actions , context ) : undefined , Principal : __expectString ( output . Principal ) , } as any ; } ; const deserializeAws_restJson1ResourcePermissionList = ( output , context ) : ResourcePermission [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ResourcePermission ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1RowInfo = ( output , context ) : RowInfo => { return { RowsDropped : __expectLong ( output . RowsDropped ) , RowsIngested : __expectLong ( output . RowsIngested ) , TotalRowsInDataset : __expectLong ( output . TotalRowsInDataset ) , } as any ; } ; const deserializeAws_restJson1RowLevelPermissionDataSet = ( output , context ) : RowLevelPermissionDataSet => { return { Arn : __expectString ( output . Arn ) , FormatVersion : __expectString ( output . FormatVersion ) , Namespace : __expectString ( output . Namespace ) , PermissionPolicy : __expectString ( output . PermissionPolicy ) , Status : __expectString ( output . Status ) , } as any ; } ; const deserializeAws_restJson1RowLevelPermissionTagConfiguration = ( output , context ) : RowLevelPermissionTagConfiguration => { return { Status : __expectString ( output . Status ) , TagRules : output . TagRules !== undefined && output . TagRules !== null ? deserializeAws_restJson1RowLevelPermissionTagRuleList ( output . TagRules , context ) : undefined , } as any ; } ; const deserializeAws_restJson1RowLevelPermissionTagRule = ( output , context ) : RowLevelPermissionTagRule => { return { ColumnName : __expectString ( output . ColumnName ) , MatchAllValue : __expectString ( output . MatchAllValue ) , TagKey : __expectString ( output . TagKey ) , TagMultiValueDelimiter : __expectString ( output . TagMultiValueDelimiter ) , } as any ; } ; const deserializeAws_restJson1RowLevelPermissionTagRuleList = ( output , context ) : RowLevelPermissionTagRule [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1RowLevelPermissionTagRule ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1S3Parameters = ( output , context ) : S3Parameters => { return { ManifestFileLocation : output . ManifestFileLocation !== undefined && output . ManifestFileLocation !== null ? deserializeAws_restJson1ManifestFileLocation ( output . ManifestFileLocation , context ) : undefined , } as any ; } ; const deserializeAws_restJson1S3Source = ( output , context ) : S3Source => { return { DataSourceArn : __expectString ( output . DataSourceArn ) , InputColumns : output . InputColumns !== undefined && output . InputColumns !== null ? deserializeAws_restJson1InputColumnList ( output . InputColumns , context ) : undefined , UploadSettings : output . UploadSettings !== undefined && output . UploadSettings !== null ? deserializeAws_restJson1UploadSettings ( output . UploadSettings , context ) : undefined , } as any ; } ; const deserializeAws_restJson1ServiceNowParameters = ( output , context ) : ServiceNowParameters => { return { SiteBaseUrl : __expectString ( output . SiteBaseUrl ) , } as any ; } ; const deserializeAws_restJson1Sheet = ( output , context ) : Sheet => { return { Name : __expectString ( output . Name ) , SheetId : __expectString ( output . SheetId ) , } as any ; } ; const deserializeAws_restJson1SheetList = ( output , context ) : Sheet [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Sheet ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1SheetStyle = ( output , context ) : SheetStyle => { return { Tile : output . Tile !== undefined && output . Tile !== null ? deserializeAws_restJson1TileStyle ( output . Tile , context ) : undefined , TileLayout : output . TileLayout !== undefined && output . TileLayout !== null ? deserializeAws_restJson1TileLayoutStyle ( output . TileLayout , context ) : undefined , } as any ; } ; const deserializeAws_restJson1SnowflakeParameters = ( output , context ) : SnowflakeParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Warehouse : __expectString ( output . Warehouse ) , } as any ; } ; const deserializeAws_restJson1SparkParameters = ( output , context ) : SparkParameters => { return { Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1SqlServerParameters = ( output , context ) : SqlServerParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1SslProperties = ( output , context ) : SslProperties => { return { DisableSsl : __expectBoolean ( output . DisableSsl ) , } as any ; } ; const deserializeAws_restJson1Tag = ( output , context ) : Tag => { return { Key : __expectString ( output . Key ) , Value : __expectString ( output . Value ) , } as any ; } ; const deserializeAws_restJson1TagColumnOperation = ( output , context ) : TagColumnOperation => { return { ColumnName : __expectString ( output . ColumnName ) , Tags : output . Tags !== undefined && output . Tags !== null ? deserializeAws_restJson1ColumnTagList ( output . Tags , context ) : undefined , } as any ; } ; const deserializeAws_restJson1TagList = ( output , context ) : Tag [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1Tag ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1Template = ( output , context ) : Template => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , TemplateId : __expectString ( output . TemplateId ) , Version : output . Version !== undefined && output . Version !== null ? deserializeAws_restJson1TemplateVersion ( output . Version , context ) : undefined , } as any ; } ; const deserializeAws_restJson1TemplateAlias = ( output , context ) : TemplateAlias => { return { AliasName : __expectString ( output . AliasName ) , Arn : __expectString ( output . Arn ) , TemplateVersionNumber : __expectLong ( output . TemplateVersionNumber ) , } as any ; } ; const deserializeAws_restJson1TemplateAliasList = ( output , context ) : TemplateAlias [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TemplateAlias ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TemplateError = ( output , context ) : TemplateError => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1TemplateErrorList = ( output , context ) : TemplateError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TemplateError ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TemplateSummary = ( output , context ) : TemplateSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , LatestVersionNumber : __expectLong ( output . LatestVersionNumber ) , Name : __expectString ( output . Name ) , TemplateId : __expectString ( output . TemplateId ) , } as any ; } ; const deserializeAws_restJson1TemplateSummaryList = ( output , context ) : TemplateSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TemplateSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TemplateVersion = ( output , context ) : TemplateVersion => { return { CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , DataSetConfigurations : output . DataSetConfigurations !== undefined && output . DataSetConfigurations !== null ? deserializeAws_restJson1DataSetConfigurationList ( output . DataSetConfigurations , context ) : undefined , Description : __expectString ( output . Description ) , Errors : output . Errors !== undefined && output . Errors !== null ? deserializeAws_restJson1TemplateErrorList ( output . Errors , context ) : undefined , Sheets : output . Sheets !== undefined && output . Sheets !== null ? deserializeAws_restJson1SheetList ( output . Sheets , context ) : undefined , SourceEntityArn : __expectString ( output . SourceEntityArn ) , Status : __expectString ( output . Status ) , ThemeArn : __expectString ( output . ThemeArn ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1TemplateVersionSummary = ( output , context ) : TemplateVersionSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , Description : __expectString ( output . Description ) , Status : __expectString ( output . Status ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1TemplateVersionSummaryList = ( output , context ) : TemplateVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TemplateVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TeradataParameters = ( output , context ) : TeradataParameters => { return { Database : __expectString ( output . Database ) , Host : __expectString ( output . Host ) , Port : __expectInt32 ( output . Port ) , } as any ; } ; const deserializeAws_restJson1Theme = ( output , context ) : Theme => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , Name : __expectString ( output . Name ) , ThemeId : __expectString ( output . ThemeId ) , Type : __expectString ( output . Type ) , Version : output . Version !== undefined && output . Version !== null ? deserializeAws_restJson1ThemeVersion ( output . Version , context ) : undefined , } as any ; } ; const deserializeAws_restJson1ThemeAlias = ( output , context ) : ThemeAlias => { return { AliasName : __expectString ( output . AliasName ) , Arn : __expectString ( output . Arn ) , ThemeVersionNumber : __expectLong ( output . ThemeVersionNumber ) , } as any ; } ; const deserializeAws_restJson1ThemeAliasList = ( output , context ) : ThemeAlias [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ThemeAlias ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ThemeConfiguration = ( output , context ) : ThemeConfiguration => { return { DataColorPalette : output . DataColorPalette !== undefined && output . DataColorPalette !== null ? deserializeAws_restJson1DataColorPalette ( output . DataColorPalette , context ) : undefined , Sheet : output . Sheet !== undefined && output . Sheet !== null ? deserializeAws_restJson1SheetStyle ( output . Sheet , context ) : undefined , UIColorPalette : output . UIColorPalette !== undefined && output . UIColorPalette !== null ? deserializeAws_restJson1UIColorPalette ( output . UIColorPalette , context ) : undefined , } as any ; } ; const deserializeAws_restJson1ThemeError = ( output , context ) : ThemeError => { return { Message : __expectString ( output . Message ) , Type : __expectString ( output . Type ) , } as any ; } ; const deserializeAws_restJson1ThemeErrorList = ( output , context ) : ThemeError [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ThemeError ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ThemeSummary = ( output , context ) : ThemeSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , LastUpdatedTime : output . LastUpdatedTime !== undefined && output . LastUpdatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . LastUpdatedTime ) ) ) : undefined , LatestVersionNumber : __expectLong ( output . LatestVersionNumber ) , Name : __expectString ( output . Name ) , ThemeId : __expectString ( output . ThemeId ) , } as any ; } ; const deserializeAws_restJson1ThemeSummaryList = ( output , context ) : ThemeSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ThemeSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1ThemeVersion = ( output , context ) : ThemeVersion => { return { Arn : __expectString ( output . Arn ) , BaseThemeId : __expectString ( output . BaseThemeId ) , Configuration : output . Configuration !== undefined && output . Configuration !== null ? deserializeAws_restJson1ThemeConfiguration ( output . Configuration , context ) : undefined , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , Description : __expectString ( output . Description ) , Errors : output . Errors !== undefined && output . Errors !== null ? deserializeAws_restJson1ThemeErrorList ( output . Errors , context ) : undefined , Status : __expectString ( output . Status ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1ThemeVersionSummary = ( output , context ) : ThemeVersionSummary => { return { Arn : __expectString ( output . Arn ) , CreatedTime : output . CreatedTime !== undefined && output . CreatedTime !== null ? __expectNonNull ( __parseEpochTimestamp ( __expectNumber ( output . CreatedTime ) ) ) : undefined , Description : __expectString ( output . Description ) , Status : __expectString ( output . Status ) , VersionNumber : __expectLong ( output . VersionNumber ) , } as any ; } ; const deserializeAws_restJson1ThemeVersionSummaryList = ( output , context ) : ThemeVersionSummary [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1ThemeVersionSummary ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1TileLayoutStyle = ( output , context ) : TileLayoutStyle => { return { Gutter : output . Gutter !== undefined && output . Gutter !== null ? deserializeAws_restJson1GutterStyle ( output . Gutter , context ) : undefined , Margin : output . Margin !== undefined && output . Margin !== null ? deserializeAws_restJson1MarginStyle ( output . Margin , context ) : undefined , } as any ; } ; const deserializeAws_restJson1TileStyle = ( output , context ) : TileStyle => { return { Border : output . Border !== undefined && output . Border !== null ? deserializeAws_restJson1BorderStyle ( output . Border , context ) : undefined , } as any ; } ; const deserializeAws_restJson1TransformOperation = ( output , context ) : TransformOperation => { if ( output . CastColumnTypeOperation !== undefined && output . CastColumnTypeOperation !== null ) { return { CastColumnTypeOperation : deserializeAws_restJson1CastColumnTypeOperation ( output . CastColumnTypeOperation , context ) , } ; } if ( output . CreateColumnsOperation !== undefined && output . CreateColumnsOperation !== null ) { return { CreateColumnsOperation : deserializeAws_restJson1CreateColumnsOperation ( output . CreateColumnsOperation , context ) , } ; } if ( output . FilterOperation !== undefined && output . FilterOperation !== null ) { return { FilterOperation : deserializeAws_restJson1FilterOperation ( output . FilterOperation , context ) , } ; } if ( output . ProjectOperation !== undefined && output . ProjectOperation !== null ) { return { ProjectOperation : deserializeAws_restJson1ProjectOperation ( output . ProjectOperation , context ) , } ; } if ( output . RenameColumnOperation !== undefined && output . RenameColumnOperation !== null ) { return { RenameColumnOperation : deserializeAws_restJson1RenameColumnOperation ( output . RenameColumnOperation , context ) , } ; } if ( output . TagColumnOperation !== undefined && output . TagColumnOperation !== null ) { return { TagColumnOperation : deserializeAws_restJson1TagColumnOperation ( output . TagColumnOperation , context ) , } ; } if ( output . UntagColumnOperation !== undefined && output . UntagColumnOperation !== null ) { return { UntagColumnOperation : deserializeAws_restJson1UntagColumnOperation ( output . UntagColumnOperation , context ) , } ; } return { $unknown : Object . entries ( output ) [ 0 ] } ; } ; const deserializeAws_restJson1TransformOperationList = ( output , context ) : TransformOperation [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1TransformOperation ( __expectUnion ( entry ) , context ) ; } ) ; } ; const deserializeAws_restJson1TwitterParameters = ( output , context ) : TwitterParameters => { return { MaxRows : __expectInt32 ( output . MaxRows ) , Query : __expectString ( output . Query ) , } as any ; } ; const deserializeAws_restJson1UIColorPalette = ( output , context ) : UIColorPalette => { return { Accent : __expectString ( output . Accent ) , AccentForeground : __expectString ( output . AccentForeground ) , Danger : __expectString ( output . Danger ) , DangerForeground : __expectString ( output . DangerForeground ) , Dimension : __expectString ( output . Dimension ) , DimensionForeground : __expectString ( output . DimensionForeground ) , Measure : __expectString ( output . Measure ) , MeasureForeground : __expectString ( output . MeasureForeground ) , PrimaryBackground : __expectString ( output . PrimaryBackground ) , PrimaryForeground : __expectString ( output . PrimaryForeground ) , SecondaryBackground : __expectString ( output . SecondaryBackground ) , SecondaryForeground : __expectString ( output . SecondaryForeground ) , Success : __expectString ( output . Success ) , SuccessForeground : __expectString ( output . SuccessForeground ) , Warning : __expectString ( output . Warning ) , WarningForeground : __expectString ( output . WarningForeground ) , } as any ; } ; const deserializeAws_restJson1UntagColumnOperation = ( output , context ) : UntagColumnOperation => { return { ColumnName : __expectString ( output . ColumnName ) , TagNames : output . TagNames !== undefined && output . TagNames !== null ? deserializeAws_restJson1ColumnTagNames ( output . TagNames , context ) : undefined , } as any ; } ; const deserializeAws_restJson1UploadSettings = ( output , context ) : UploadSettings => { return { ContainsHeader : __expectBoolean ( output . ContainsHeader ) , Delimiter : __expectString ( output . Delimiter ) , Format : __expectString ( output . Format ) , StartFromRow : __expectInt32 ( output . StartFromRow ) , TextQualifier : __expectString ( output . TextQualifier ) , } as any ; } ; const deserializeAws_restJson1User = ( output , context ) : User => { return { Active : __expectBoolean ( output . Active ) , Arn : __expectString ( output . Arn ) , CustomPermissionsName : __expectString ( output . CustomPermissionsName ) , Email : __expectString ( output . Email ) , ExternalLoginFederationProviderType : __expectString ( output . ExternalLoginFederationProviderType ) , ExternalLoginFederationProviderUrl : __expectString ( output . ExternalLoginFederationProviderUrl ) , ExternalLoginId : __expectString ( output . ExternalLoginId ) , IdentityType : __expectString ( output . IdentityType ) , PrincipalId : __expectString ( output . PrincipalId ) , Role : __expectString ( output . Role ) , UserName : __expectString ( output . UserName ) , } as any ; } ; const deserializeAws_restJson1UserList = ( output , context ) : User [ ] => { return ( output || [ ] ) . filter ( ( e ) => e != null ) . map ( ( entry ) => { if ( entry === null ) { return null as any ; } return deserializeAws_restJson1User ( entry , context ) ; } ) ; } ; const deserializeAws_restJson1VpcConnectionProperties = ( output , context ) : VpcConnectionProperties => { return { VpcConnectionArn : __expectString ( output . VpcConnectionArn ) , } as any ; } ; const deserializeMetadata = ( output ) : __ResponseMetadata => ( { httpStatusCode : output . statusCode , requestId : output . headers [ "x-amzn-requestid" ] ?? output . headers [ "x-amzn-request-id" ] , extendedRequestId : output . headers [ "x-amz-id-2" ] , cfId : output . headers [ "x-amz-cf-id" ] , } ) ; const collectBody = ( streamBody = new Uint8Array ( ) , context ) : Promise < Uint8Array > => { if ( streamBody instanceof Uint8Array ) { return Promise . resolve ( streamBody ) ; } return context . streamCollector ( streamBody ) || Promise . resolve ( new Uint8Array ( ) ) ; } ; const collectBodyString = ( streamBody , context ) : Promise < string > => collectBody ( streamBody , context ) . then ( ( body ) => context . utf8Encoder ( body ) ) ; const isSerializableHeaderValue = ( value ) : boolean => value !== undefined && value !== null && value !== "" && ( ! Object . getOwnPropertyNames ( value ) . includes ( "length" ) || value . length != 0 ) && ( ! Object . getOwnPropertyNames ( value ) . includes ( "size" ) || value . size != 0 ) ; 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 "" ; } ;