/* 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 { AvgAggregationFromJSONTyped, AvgAggregationToJSON, } from './AvgAggregation';
import { MaxAggregationFromJSONTyped, MaxAggregationToJSON, } from './MaxAggregation';
import { MinAggregationFromJSONTyped, MinAggregationToJSON, } from './MinAggregation';
import { SumAggregationFromJSONTyped, SumAggregationToJSON, } from './SumAggregation';
export function MetricAggregationFromJSON(json) {
    return MetricAggregationFromJSONTyped(json, false);
}
export function MetricAggregationFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        case 'org.sagebionetworks.repo.model.search.dsl.AvgAggregation':
            return Object.assign({}, AvgAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.AvgAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.MaxAggregation':
            return Object.assign({}, MaxAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.MaxAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.MinAggregation':
            return Object.assign({}, MinAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.MinAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.SumAggregation':
            return Object.assign({}, SumAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.SumAggregation' });
        default:
            return json;
    }
}
export function MetricAggregationToJSON(json) {
    return MetricAggregationToJSONTyped(json, false);
}
export function MetricAggregationToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        case 'org.sagebionetworks.repo.model.search.dsl.AvgAggregation':
            return Object.assign({}, AvgAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.AvgAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.MaxAggregation':
            return Object.assign({}, MaxAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.MaxAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.MinAggregation':
            return Object.assign({}, MinAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.MinAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.SumAggregation':
            return Object.assign({}, SumAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.SumAggregation' });
        default:
            return value;
    }
}
//# sourceMappingURL=MetricAggregation.js.map