/* 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 { EntityViewFromJSONTyped, EntityViewToJSON, } from './EntityView';
import { FileEntityFromJSONTyped, FileEntityToJSON, } from './FileEntity';
import { MaterializedViewFromJSONTyped, MaterializedViewToJSON, } from './MaterializedView';
import { RecordSetFromJSONTyped, RecordSetToJSON, } from './RecordSet';
import { SubmissionViewFromJSONTyped, SubmissionViewToJSON, } from './SubmissionView';
import { TableEntityFromJSONTyped, TableEntityToJSON, } from './TableEntity';
import { VirtualTableFromJSONTyped, VirtualTableToJSON, } from './VirtualTable';
export function VersionableEntityFromJSON(json) {
    return VersionableEntityFromJSONTyped(json, false);
}
export function VersionableEntityFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        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 VersionableEntityToJSON(json) {
    return VersionableEntityToJSONTyped(json, false);
}
export function VersionableEntityToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        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=VersionableEntity.js.map