/* 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 { SubmissionViewFromJSONTyped, SubmissionViewToJSON, } from './SubmissionView';
export function ViewFromJSON(json) {
    return ViewFromJSONTyped(json, false);
}
export function ViewFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        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.SubmissionView':
            return Object.assign({}, SubmissionViewFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.table.SubmissionView' });
        default:
            return json;
    }
}
export function ViewToJSON(json) {
    return ViewToJSONTyped(json, false);
}
export function ViewToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        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.SubmissionView':
            return Object.assign({}, SubmissionViewToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.table.SubmissionView' });
        default:
            return value;
    }
}
//# sourceMappingURL=View.js.map