/* 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 { mapValues } from '../runtime';
import { MatchPhrasePrefixFieldOptionsFromJSON, MatchPhrasePrefixFieldOptionsToJSON, } from './MatchPhrasePrefixFieldOptions';
import { MatchPhraseFieldOptionsFromJSON, MatchPhraseFieldOptionsToJSON, } from './MatchPhraseFieldOptions';
import { ExistsQueryFromJSON, ExistsQueryToJSON, } from './ExistsQuery';
import { WildcardFieldOptionsFromJSON, WildcardFieldOptionsToJSON, } from './WildcardFieldOptions';
import { BoolQueryFromJSON, BoolQueryToJSON, } from './BoolQuery';
import { RangeFieldOptionsFromJSON, RangeFieldOptionsToJSON, } from './RangeFieldOptions';
import { PrefixFieldOptionsFromJSON, PrefixFieldOptionsToJSON, } from './PrefixFieldOptions';
import { FuzzyFieldOptionsFromJSON, FuzzyFieldOptionsToJSON, } from './FuzzyFieldOptions';
import { MultiMatchQueryFromJSON, MultiMatchQueryToJSON, } from './MultiMatchQuery';
import { DisMaxQueryFromJSON, DisMaxQueryToJSON, } from './DisMaxQuery';
import { SimpleQueryStringQueryFromJSON, SimpleQueryStringQueryToJSON, } from './SimpleQueryStringQuery';
import { TermFieldOptionsFromJSON, TermFieldOptionsToJSON, } from './TermFieldOptions';
import { BoostingQueryFromJSON, BoostingQueryToJSON, } from './BoostingQuery';
import { ConstantScoreQueryFromJSON, ConstantScoreQueryToJSON, } from './ConstantScoreQuery';
import { MatchBoolPrefixFieldOptionsFromJSON, MatchBoolPrefixFieldOptionsToJSON, } from './MatchBoolPrefixFieldOptions';
import { MatchAllQueryFromJSON, MatchAllQueryToJSON, } from './MatchAllQuery';
import { MatchFieldOptionsFromJSON, MatchFieldOptionsToJSON, } from './MatchFieldOptions';
/**
 * Check if a given object implements the DslQuery interface.
 */
export function instanceOfDslQuery(value) {
    return true;
}
export function DslQueryFromJSON(json) {
    return DslQueryFromJSONTyped(json, false);
}
export function DslQueryFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'match': json['match'] == null ? undefined : (mapValues(json['match'], MatchFieldOptionsFromJSON)),
        'match_phrase': json['match_phrase'] == null ? undefined : (mapValues(json['match_phrase'], MatchPhraseFieldOptionsFromJSON)),
        'match_phrase_prefix': json['match_phrase_prefix'] == null ? undefined : (mapValues(json['match_phrase_prefix'], MatchPhrasePrefixFieldOptionsFromJSON)),
        'match_bool_prefix': json['match_bool_prefix'] == null ? undefined : (mapValues(json['match_bool_prefix'], MatchBoolPrefixFieldOptionsFromJSON)),
        'term': json['term'] == null ? undefined : (mapValues(json['term'], TermFieldOptionsFromJSON)),
        'range': json['range'] == null ? undefined : (mapValues(json['range'], RangeFieldOptionsFromJSON)),
        'prefix': json['prefix'] == null ? undefined : (mapValues(json['prefix'], PrefixFieldOptionsFromJSON)),
        'wildcard': json['wildcard'] == null ? undefined : (mapValues(json['wildcard'], WildcardFieldOptionsFromJSON)),
        'fuzzy': json['fuzzy'] == null ? undefined : (mapValues(json['fuzzy'], FuzzyFieldOptionsFromJSON)),
        'terms': json['terms'] == null ? undefined : json['terms'],
        '_exists': json['exists'] == null ? undefined : ExistsQueryFromJSON(json['exists']),
        'multi_match': json['multi_match'] == null ? undefined : MultiMatchQueryFromJSON(json['multi_match']),
        'simple_query_string': json['simple_query_string'] == null ? undefined : SimpleQueryStringQueryFromJSON(json['simple_query_string']),
        'match_all': json['match_all'] == null ? undefined : MatchAllQueryFromJSON(json['match_all']),
        'bool': json['bool'] == null ? undefined : BoolQueryFromJSON(json['bool']),
        'dis_max': json['dis_max'] == null ? undefined : DisMaxQueryFromJSON(json['dis_max']),
        'constant_score': json['constant_score'] == null ? undefined : ConstantScoreQueryFromJSON(json['constant_score']),
        'boosting': json['boosting'] == null ? undefined : BoostingQueryFromJSON(json['boosting']),
    };
}
export function DslQueryToJSON(json) {
    return DslQueryToJSONTyped(json, false);
}
export function DslQueryToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'match': value['match'] == null ? undefined : (mapValues(value['match'], MatchFieldOptionsToJSON)),
        'match_phrase': value['match_phrase'] == null ? undefined : (mapValues(value['match_phrase'], MatchPhraseFieldOptionsToJSON)),
        'match_phrase_prefix': value['match_phrase_prefix'] == null ? undefined : (mapValues(value['match_phrase_prefix'], MatchPhrasePrefixFieldOptionsToJSON)),
        'match_bool_prefix': value['match_bool_prefix'] == null ? undefined : (mapValues(value['match_bool_prefix'], MatchBoolPrefixFieldOptionsToJSON)),
        'term': value['term'] == null ? undefined : (mapValues(value['term'], TermFieldOptionsToJSON)),
        'range': value['range'] == null ? undefined : (mapValues(value['range'], RangeFieldOptionsToJSON)),
        'prefix': value['prefix'] == null ? undefined : (mapValues(value['prefix'], PrefixFieldOptionsToJSON)),
        'wildcard': value['wildcard'] == null ? undefined : (mapValues(value['wildcard'], WildcardFieldOptionsToJSON)),
        'fuzzy': value['fuzzy'] == null ? undefined : (mapValues(value['fuzzy'], FuzzyFieldOptionsToJSON)),
        'terms': value['terms'],
        'exists': ExistsQueryToJSON(value['_exists']),
        'multi_match': MultiMatchQueryToJSON(value['multi_match']),
        'simple_query_string': SimpleQueryStringQueryToJSON(value['simple_query_string']),
        'match_all': MatchAllQueryToJSON(value['match_all']),
        'bool': BoolQueryToJSON(value['bool']),
        'dis_max': DisMaxQueryToJSON(value['dis_max']),
        'constant_score': ConstantScoreQueryToJSON(value['constant_score']),
        'boosting': BoostingQueryToJSON(value['boosting']),
    };
}
//# sourceMappingURL=DslQuery.js.map