/* tslint:disable */
/* eslint-disable */
/**
 * Synapse REST API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: v1
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
import { DatasetFromJSONTyped, DatasetToJSON, } from './Dataset';
import { DatasetCollectionFromJSONTyped, DatasetCollectionToJSON, } from './DatasetCollection';
import { DockerRepositoryFromJSONTyped, DockerRepositoryToJSON, } from './DockerRepository';
import { EntityViewFromJSONTyped, EntityViewToJSON, } from './EntityView';
import { ExampleEntityFromJSONTyped, ExampleEntityToJSON, } from './ExampleEntity';
import { FileEntityFromJSONTyped, FileEntityToJSON, } from './FileEntity';
import { FolderFromJSONTyped, FolderToJSON, } from './Folder';
import { LinkFromJSONTyped, LinkToJSON, } from './Link';
import { MaterializedViewFromJSONTyped, MaterializedViewToJSON, } from './MaterializedView';
import { PreviewFromJSONTyped, PreviewToJSON, } from './Preview';
import { ProjectFromJSONTyped, ProjectToJSON, } from './Project';
import { RecordSetFromJSONTyped, RecordSetToJSON, } from './RecordSet';
import { SearchIndexFromJSONTyped, SearchIndexToJSON, } from './SearchIndex';
import { SubmissionViewFromJSONTyped, SubmissionViewToJSON, } from './SubmissionView';
import { TableEntityFromJSONTyped, TableEntityToJSON, } from './TableEntity';
import { VirtualTableFromJSONTyped, VirtualTableToJSON, } from './VirtualTable';
export function EntityFromJSON(json) {
    return EntityFromJSONTyped(json, false);
}
export function EntityFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        case 'org.sagebionetworks.repo.model.ExampleEntity':
            return Object.assign({}, ExampleEntityFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.ExampleEntity' });
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.Folder':
            return Object.assign({}, FolderFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.Folder' });
        case 'org.sagebionetworks.repo.model.Link':
            return Object.assign({}, LinkFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.Link' });
        case 'org.sagebionetworks.repo.model.Preview':
            return Object.assign({}, PreviewFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.Preview' });
        case 'org.sagebionetworks.repo.model.Project':
            return Object.assign({}, ProjectFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.Project' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        case 'org.sagebionetworks.repo.model.docker.DockerRepository':
            return Object.assign({}, DockerRepositoryFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.docker.DockerRepository' });
        case 'org.sagebionetworks.repo.model.search.table.SearchIndex':
            return Object.assign({}, SearchIndexFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndex' });
        case 'org.sagebionetworks.repo.model.table.Dataset':
            return Object.assign({}, DatasetFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.Dataset' });
        case 'org.sagebionetworks.repo.model.table.DatasetCollection':
            return Object.assign({}, DatasetCollectionFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.DatasetCollection' });
        case 'org.sagebionetworks.repo.model.table.EntityView':
            return Object.assign({}, EntityViewFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.EntityView' });
        case 'org.sagebionetworks.repo.model.table.MaterializedView':
            return Object.assign({}, MaterializedViewFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.MaterializedView' });
        case 'org.sagebionetworks.repo.model.table.SubmissionView':
            return Object.assign({}, SubmissionViewFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.SubmissionView' });
        case 'org.sagebionetworks.repo.model.table.TableEntity':
            return Object.assign({}, TableEntityFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.TableEntity' });
        case 'org.sagebionetworks.repo.model.table.VirtualTable':
            return Object.assign({}, VirtualTableFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.VirtualTable' });
        default:
            return json;
    }
}
export function EntityToJSON(json) {
    return EntityToJSONTyped(json, false);
}
export function EntityToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        case 'org.sagebionetworks.repo.model.ExampleEntity':
            return Object.assign({}, ExampleEntityToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.ExampleEntity' });
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.Folder':
            return Object.assign({}, FolderToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.Folder' });
        case 'org.sagebionetworks.repo.model.Link':
            return Object.assign({}, LinkToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.Link' });
        case 'org.sagebionetworks.repo.model.Preview':
            return Object.assign({}, PreviewToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.Preview' });
        case 'org.sagebionetworks.repo.model.Project':
            return Object.assign({}, ProjectToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.Project' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        case 'org.sagebionetworks.repo.model.docker.DockerRepository':
            return Object.assign({}, DockerRepositoryToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.docker.DockerRepository' });
        case 'org.sagebionetworks.repo.model.search.table.SearchIndex':
            return Object.assign({}, SearchIndexToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.table.SearchIndex' });
        case 'org.sagebionetworks.repo.model.table.Dataset':
            return Object.assign({}, DatasetToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.Dataset' });
        case 'org.sagebionetworks.repo.model.table.DatasetCollection':
            return Object.assign({}, DatasetCollectionToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.DatasetCollection' });
        case 'org.sagebionetworks.repo.model.table.EntityView':
            return Object.assign({}, EntityViewToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.EntityView' });
        case 'org.sagebionetworks.repo.model.table.MaterializedView':
            return Object.assign({}, MaterializedViewToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.MaterializedView' });
        case 'org.sagebionetworks.repo.model.table.SubmissionView':
            return Object.assign({}, SubmissionViewToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.SubmissionView' });
        case 'org.sagebionetworks.repo.model.table.TableEntity':
            return Object.assign({}, TableEntityToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.TableEntity' });
        case 'org.sagebionetworks.repo.model.table.VirtualTable':
            return Object.assign({}, VirtualTableToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.VirtualTable' });
        default:
            return value;
    }
}
//# sourceMappingURL=Entity.js.map