/* tslint:disable */
/* eslint-disable */
/**
 * AskNews API
 * AskNews API [![status](https://status.asknews.app/api/badge/2/status?style=for-the-badge)](https://status.asknews.app/status/prod)
 *
 * The version of the OpenAPI document: 0.24.66
 * Contact: contact@emergentmethods.ai
 *
 * 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 type { DomainQueryArticleItem } from './DomainQueryArticleItem';
import {
    DomainQueryArticleItemFromJSON,
    DomainQueryArticleItemFromJSONTyped,
    DomainQueryArticleItemToJSON,
    DomainQueryArticleItemToJSONTyped,
} from './DomainQueryArticleItem';

/**
 * 
 * @export
 * @interface DomainQueryItem
 */
export interface DomainQueryItem {
    /**
     * 
     * @type {string}
     * @memberof DomainQueryItem
     */
    query: string;
    /**
     * 
     * @type {Array<any>}
     * @memberof DomainQueryItem
     */
    coords: Array<any>;
    /**
     * 
     * @type {number}
     * @memberof DomainQueryItem
     */
    nHits: number;
    /**
     * 
     * @type {Array<DomainQueryArticleItem>}
     * @memberof DomainQueryItem
     */
    articles: Array<DomainQueryArticleItem>;
}

/**
 * Check if a given object implements the DomainQueryItem interface.
 */
export function instanceOfDomainQueryItem(value: object): value is DomainQueryItem {
    if (!('query' in value) || value['query'] === undefined) return false;
    if (!('coords' in value) || value['coords'] === undefined) return false;
    if (!('nHits' in value) || value['nHits'] === undefined) return false;
    if (!('articles' in value) || value['articles'] === undefined) return false;
    return true;
}

export function DomainQueryItemFromJSON(json: any): DomainQueryItem {
    return DomainQueryItemFromJSONTyped(json, false);
}

export function DomainQueryItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): DomainQueryItem {
    if (json == null) {
        return json;
    }
    return {
        
        'query': json['query'],
        'coords': json['coords'],
        'nHits': json['n_hits'],
        'articles': ((json['articles'] as Array<any>).map(DomainQueryArticleItemFromJSON)),
    };
}

export function DomainQueryItemToJSON(json: any): DomainQueryItem {
    return DomainQueryItemToJSONTyped(json, false);
}

export function DomainQueryItemToJSONTyped(value?: DomainQueryItem | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'query': value['query'],
        'coords': value['coords'],
        'n_hits': value['nHits'],
        'articles': ((value['articles'] as Array<any>).map(DomainQueryArticleItemToJSON)),
    };
}

