/* 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 { DateHistogramAggregationFromJSONTyped, DateHistogramAggregationToJSON, } from './DateHistogramAggregation';
import { DateRangeAggregationFromJSONTyped, DateRangeAggregationToJSON, } from './DateRangeAggregation';
import { HistogramAggregationFromJSONTyped, HistogramAggregationToJSON, } from './HistogramAggregation';
import { RangeAggregationFromJSONTyped, RangeAggregationToJSON, } from './RangeAggregation';
export function KeyedBucketOptionFromJSON(json) {
    return KeyedBucketOptionFromJSONTyped(json, false);
}
export function KeyedBucketOptionFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    switch (json['concreteType']) {
        case 'org.sagebionetworks.repo.model.search.dsl.DateHistogramAggregation':
            return Object.assign({}, DateHistogramAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.DateHistogramAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.DateRangeAggregation':
            return Object.assign({}, DateRangeAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.DateRangeAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.HistogramAggregation':
            return Object.assign({}, HistogramAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.HistogramAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.RangeAggregation':
            return Object.assign({}, RangeAggregationFromJSONTyped(json, true), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.RangeAggregation' });
        default:
            return json;
    }
}
export function KeyedBucketOptionToJSON(json) {
    return KeyedBucketOptionToJSONTyped(json, false);
}
export function KeyedBucketOptionToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    switch (value['concreteType']) {
        case 'org.sagebionetworks.repo.model.search.dsl.DateHistogramAggregation':
            return Object.assign({}, DateHistogramAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.DateHistogramAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.DateRangeAggregation':
            return Object.assign({}, DateRangeAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.DateRangeAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.HistogramAggregation':
            return Object.assign({}, HistogramAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.HistogramAggregation' });
        case 'org.sagebionetworks.repo.model.search.dsl.RangeAggregation':
            return Object.assign({}, RangeAggregationToJSON(value), { concreteType: 'org.sagebionetworks.repo.model.search.dsl.RangeAggregation' });
        default:
            return value;
    }
}
//# sourceMappingURL=KeyedBucketOption.js.map