/* 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 { ACTAccessRequirementFromJSONTyped, ACTAccessRequirementToJSON, } from './ACTAccessRequirement';
import { DatasetFromJSONTyped, DatasetToJSON, } from './Dataset';
import { DatasetCollectionFromJSONTyped, DatasetCollectionToJSON, } from './DatasetCollection';
import { EntityViewFromJSONTyped, EntityViewToJSON, } from './EntityView';
import { FileEntityFromJSONTyped, FileEntityToJSON, } from './FileEntity';
import { LockAccessRequirementFromJSONTyped, LockAccessRequirementToJSON, } from './LockAccessRequirement';
import { ManagedACTAccessRequirementFromJSONTyped, ManagedACTAccessRequirementToJSON, } from './ManagedACTAccessRequirement';
import { MaterializedViewFromJSONTyped, MaterializedViewToJSON, } from './MaterializedView';
import { PostMessageContentAccessRequirementFromJSONTyped, PostMessageContentAccessRequirementToJSON, } from './PostMessageContentAccessRequirement';
import { RecordSetFromJSONTyped, RecordSetToJSON, } from './RecordSet';
import { SelfSignAccessRequirementFromJSONTyped, SelfSignAccessRequirementToJSON, } from './SelfSignAccessRequirement';
import { SubmissionViewFromJSONTyped, SubmissionViewToJSON, } from './SubmissionView';
import { TableEntityFromJSONTyped, TableEntityToJSON, } from './TableEntity';
import { TermsOfUseAccessRequirementFromJSONTyped, TermsOfUseAccessRequirementToJSON, } from './TermsOfUseAccessRequirement';
import { VirtualTableFromJSONTyped, VirtualTableToJSON, } from './VirtualTable';
export function VersionableFromJSON(json) {
    return VersionableFromJSONTyped(json, false);
}
export function VersionableFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        case 'org.sagebionetworks.repo.model.ACTAccessRequirement':
            return Object.assign({}, ACTAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.ACTAccessRequirement' });
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.LockAccessRequirement':
            return Object.assign({}, LockAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.LockAccessRequirement' });
        case 'org.sagebionetworks.repo.model.ManagedACTAccessRequirement':
            return Object.assign({}, ManagedACTAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.ManagedACTAccessRequirement' });
        case 'org.sagebionetworks.repo.model.PostMessageContentAccessRequirement':
            return Object.assign({}, PostMessageContentAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.PostMessageContentAccessRequirement' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        case 'org.sagebionetworks.repo.model.SelfSignAccessRequirement':
            return Object.assign({}, SelfSignAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.SelfSignAccessRequirement' });
        case 'org.sagebionetworks.repo.model.TermsOfUseAccessRequirement':
            return Object.assign({}, TermsOfUseAccessRequirementFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.TermsOfUseAccessRequirement' });
        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 VersionableToJSON(json) {
    return VersionableToJSONTyped(json, false);
}
export function VersionableToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        case 'org.sagebionetworks.repo.model.ACTAccessRequirement':
            return Object.assign({}, ACTAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.ACTAccessRequirement' });
        case 'org.sagebionetworks.repo.model.FileEntity':
            return Object.assign({}, FileEntityToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.FileEntity' });
        case 'org.sagebionetworks.repo.model.LockAccessRequirement':
            return Object.assign({}, LockAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.LockAccessRequirement' });
        case 'org.sagebionetworks.repo.model.ManagedACTAccessRequirement':
            return Object.assign({}, ManagedACTAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.ManagedACTAccessRequirement' });
        case 'org.sagebionetworks.repo.model.PostMessageContentAccessRequirement':
            return Object.assign({}, PostMessageContentAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.PostMessageContentAccessRequirement' });
        case 'org.sagebionetworks.repo.model.RecordSet':
            return Object.assign({}, RecordSetToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.RecordSet' });
        case 'org.sagebionetworks.repo.model.SelfSignAccessRequirement':
            return Object.assign({}, SelfSignAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.SelfSignAccessRequirement' });
        case 'org.sagebionetworks.repo.model.TermsOfUseAccessRequirement':
            return Object.assign({}, TermsOfUseAccessRequirementToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.TermsOfUseAccessRequirement' });
        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=Versionable.js.map