/* 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 { Assets } from './Assets';
import {
    AssetsFromJSON,
    AssetsFromJSONTyped,
    AssetsToJSON,
    AssetsToJSONTyped,
} from './Assets';
import type { Classification } from './Classification';
import {
    ClassificationFromJSON,
    ClassificationFromJSONTyped,
    ClassificationToJSON,
    ClassificationToJSONTyped,
} from './Classification';
import type { AsknewsApiSchemaV1CommonGraphRelationships } from './AsknewsApiSchemaV1CommonGraphRelationships';
import {
    AsknewsApiSchemaV1CommonGraphRelationshipsFromJSON,
    AsknewsApiSchemaV1CommonGraphRelationshipsFromJSONTyped,
    AsknewsApiSchemaV1CommonGraphRelationshipsToJSON,
    AsknewsApiSchemaV1CommonGraphRelationshipsToJSONTyped,
} from './AsknewsApiSchemaV1CommonGraphRelationships';
import type { Author } from './Author';
import {
    AuthorFromJSON,
    AuthorFromJSONTyped,
    AuthorToJSON,
    AuthorToJSONTyped,
} from './Author';
import type { GeoCoordinate } from './GeoCoordinate';
import {
    GeoCoordinateFromJSON,
    GeoCoordinateFromJSONTyped,
    GeoCoordinateToJSON,
    GeoCoordinateToJSONTyped,
} from './GeoCoordinate';
import type { ReportingVoice1 } from './ReportingVoice1';
import {
    ReportingVoice1FromJSON,
    ReportingVoice1FromJSONTyped,
    ReportingVoice1ToJSON,
    ReportingVoice1ToJSONTyped,
} from './ReportingVoice1';
import type { Entities } from './Entities';
import {
    EntitiesFromJSON,
    EntitiesFromJSONTyped,
    EntitiesToJSON,
    EntitiesToJSONTyped,
} from './Entities';

/**
 * 
 * @export
 * @interface SearchResponseDictItem
 */
export interface SearchResponseDictItem {
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    articleUrl: string;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    articleId: string;
    /**
     * 
     * @type {Classification}
     * @memberof SearchResponseDictItem
     */
    classification: Classification;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    country: string;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    sourceId: string;
    /**
     * 
     * @type {number}
     * @memberof SearchResponseDictItem
     */
    pageRank: number;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    domainUrl: string;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    engTitle: string;
    /**
     * 
     * @type {Entities}
     * @memberof SearchResponseDictItem
     */
    entities: Entities;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    imageUrl?: string | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof SearchResponseDictItem
     */
    keywords: Array<string>;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    language: string;
    /**
     * 
     * @type {Date}
     * @memberof SearchResponseDictItem
     */
    pubDate: Date;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    summary: string;
    /**
     * 
     * @type {Array<string>}
     * @memberof SearchResponseDictItem
     */
    keyPoints?: Array<string> | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    title: string;
    /**
     * 
     * @type {number}
     * @memberof SearchResponseDictItem
     */
    sentiment: number;
    /**
     * 
     * @type {number}
     * @memberof SearchResponseDictItem
     */
    centroidDistance: number;
    /**
     * 
     * @type {number}
     * @memberof SearchResponseDictItem
     */
    clusterProbability: number;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    markdownCitation?: string;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    provocative?: SearchResponseDictItemProvocativeEnum;
    /**
     * 
     * @type {ReportingVoice1}
     * @memberof SearchResponseDictItem
     */
    reportingVoice?: ReportingVoice1;
    /**
     * 
     * @type {AsknewsApiSchemaV1CommonGraphRelationships}
     * @memberof SearchResponseDictItem
     */
    entityRelationGraph?: AsknewsApiSchemaV1CommonGraphRelationships | null;
    /**
     * 
     * @type {{ [key: string]: GeoCoordinate; }}
     * @memberof SearchResponseDictItem
     */
    geoCoordinates?: { [key: string]: GeoCoordinate; } | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    continent?: SearchResponseDictItemContinentEnum | null;
    /**
     * 
     * @type {Assets}
     * @memberof SearchResponseDictItem
     */
    assets?: Assets | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof SearchResponseDictItem
     */
    socialEmbeds?: Array<string> | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    bias?: SearchResponseDictItemBiasEnum | null;
    /**
     * 
     * @type {Array<Author>}
     * @memberof SearchResponseDictItem
     */
    authors?: Array<Author> | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    fullText?: string | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    originalLanguageSummary?: string | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    imageDescription?: string | null;
    /**
     * 
     * @type {string}
     * @memberof SearchResponseDictItem
     */
    asStringKey: string;
}


/**
 * @export
 */
export const SearchResponseDictItemProvocativeEnum = {
    Unknown: 'unknown',
    Low: 'low',
    Medium: 'medium',
    High: 'high'
} as const;
export type SearchResponseDictItemProvocativeEnum = typeof SearchResponseDictItemProvocativeEnum[keyof typeof SearchResponseDictItemProvocativeEnum];

/**
 * @export
 */
export const SearchResponseDictItemContinentEnum = {
    Africa: 'Africa',
    Asia: 'Asia',
    Europe: 'Europe',
    MiddleEast: 'Middle East',
    NorthAmerica: 'North America',
    SouthAmerica: 'South America',
    Oceania: 'Oceania'
} as const;
export type SearchResponseDictItemContinentEnum = typeof SearchResponseDictItemContinentEnum[keyof typeof SearchResponseDictItemContinentEnum];

/**
 * @export
 */
export const SearchResponseDictItemBiasEnum = {
    Political: 'Political',
    Gender: 'Gender',
    Cultural: 'Cultural',
    Age: 'Age',
    Religious: 'Religious',
    Statement: 'Statement',
    IllogicalClaims: 'Illogical Claims',
    Slant: 'Slant',
    SourceSelection: 'Source Selection',
    OmissionOfSourceAttribution: 'Omission of Source Attribution',
    Spin: 'Spin',
    Sensationalism: 'Sensationalism',
    Negativity: 'Negativity',
    SubjectiveAdjectives: 'Subjective Adjectives',
    AdHominem: 'Ad Hominem',
    MindReading: 'Mind Reading',
    OpinionAsFact: 'Opinion-as-Fact',
    None: 'None',
    Unknown: 'Unknown'
} as const;
export type SearchResponseDictItemBiasEnum = typeof SearchResponseDictItemBiasEnum[keyof typeof SearchResponseDictItemBiasEnum];


/**
 * Check if a given object implements the SearchResponseDictItem interface.
 */
export function instanceOfSearchResponseDictItem(value: object): value is SearchResponseDictItem {
    if (!('articleUrl' in value) || value['articleUrl'] === undefined) return false;
    if (!('articleId' in value) || value['articleId'] === undefined) return false;
    if (!('classification' in value) || value['classification'] === undefined) return false;
    if (!('country' in value) || value['country'] === undefined) return false;
    if (!('sourceId' in value) || value['sourceId'] === undefined) return false;
    if (!('pageRank' in value) || value['pageRank'] === undefined) return false;
    if (!('domainUrl' in value) || value['domainUrl'] === undefined) return false;
    if (!('engTitle' in value) || value['engTitle'] === undefined) return false;
    if (!('entities' in value) || value['entities'] === undefined) return false;
    if (!('keywords' in value) || value['keywords'] === undefined) return false;
    if (!('language' in value) || value['language'] === undefined) return false;
    if (!('pubDate' in value) || value['pubDate'] === undefined) return false;
    if (!('summary' in value) || value['summary'] === undefined) return false;
    if (!('title' in value) || value['title'] === undefined) return false;
    if (!('sentiment' in value) || value['sentiment'] === undefined) return false;
    if (!('centroidDistance' in value) || value['centroidDistance'] === undefined) return false;
    if (!('clusterProbability' in value) || value['clusterProbability'] === undefined) return false;
    if (!('asStringKey' in value) || value['asStringKey'] === undefined) return false;
    return true;
}

export function SearchResponseDictItemFromJSON(json: any): SearchResponseDictItem {
    return SearchResponseDictItemFromJSONTyped(json, false);
}

export function SearchResponseDictItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): SearchResponseDictItem {
    if (json == null) {
        return json;
    }
    return {
        
        'articleUrl': json['article_url'],
        'articleId': json['article_id'],
        'classification': ClassificationFromJSON(json['classification']),
        'country': json['country'],
        'sourceId': json['source_id'],
        'pageRank': json['page_rank'],
        'domainUrl': json['domain_url'],
        'engTitle': json['eng_title'],
        'entities': EntitiesFromJSON(json['entities']),
        'imageUrl': json['image_url'] == null ? undefined : json['image_url'],
        'keywords': json['keywords'],
        'language': json['language'],
        'pubDate': (new Date(json['pub_date'])),
        'summary': json['summary'],
        'keyPoints': json['key_points'] == null ? undefined : json['key_points'],
        'title': json['title'],
        'sentiment': json['sentiment'],
        'centroidDistance': json['centroid_distance'],
        'clusterProbability': json['cluster_probability'],
        'markdownCitation': json['markdown_citation'] == null ? undefined : json['markdown_citation'],
        'provocative': json['provocative'] == null ? undefined : json['provocative'],
        'reportingVoice': json['reporting_voice'] == null ? undefined : ReportingVoice1FromJSON(json['reporting_voice']),
        'entityRelationGraph': json['entity_relation_graph'] == null ? undefined : AsknewsApiSchemaV1CommonGraphRelationshipsFromJSON(json['entity_relation_graph']),
        'geoCoordinates': json['geo_coordinates'] == null ? undefined : (mapValues(json['geo_coordinates'], GeoCoordinateFromJSON)),
        'continent': json['continent'] == null ? undefined : json['continent'],
        'assets': json['assets'] == null ? undefined : AssetsFromJSON(json['assets']),
        'socialEmbeds': json['social_embeds'] == null ? undefined : json['social_embeds'],
        'bias': json['bias'] == null ? undefined : json['bias'],
        'authors': json['authors'] == null ? undefined : ((json['authors'] as Array<any>).map(AuthorFromJSON)),
        'fullText': json['full_text'] == null ? undefined : json['full_text'],
        'originalLanguageSummary': json['original_language_summary'] == null ? undefined : json['original_language_summary'],
        'imageDescription': json['image_description'] == null ? undefined : json['image_description'],
        'asStringKey': json['as_string_key'],
    };
}

export function SearchResponseDictItemToJSON(json: any): SearchResponseDictItem {
    return SearchResponseDictItemToJSONTyped(json, false);
}

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

    return {
        
        'article_url': value['articleUrl'],
        'article_id': value['articleId'],
        'classification': ClassificationToJSON(value['classification']),
        'country': value['country'],
        'source_id': value['sourceId'],
        'page_rank': value['pageRank'],
        'domain_url': value['domainUrl'],
        'eng_title': value['engTitle'],
        'entities': EntitiesToJSON(value['entities']),
        'image_url': value['imageUrl'],
        'keywords': value['keywords'],
        'language': value['language'],
        'pub_date': ((value['pubDate']).toISOString()),
        'summary': value['summary'],
        'key_points': value['keyPoints'],
        'title': value['title'],
        'sentiment': value['sentiment'],
        'centroid_distance': value['centroidDistance'],
        'cluster_probability': value['clusterProbability'],
        'markdown_citation': value['markdownCitation'],
        'provocative': value['provocative'],
        'reporting_voice': ReportingVoice1ToJSON(value['reportingVoice']),
        'entity_relation_graph': AsknewsApiSchemaV1CommonGraphRelationshipsToJSON(value['entityRelationGraph']),
        'geo_coordinates': value['geoCoordinates'] == null ? undefined : (mapValues(value['geoCoordinates'], GeoCoordinateToJSON)),
        'continent': value['continent'],
        'assets': AssetsToJSON(value['assets']),
        'social_embeds': value['socialEmbeds'],
        'bias': value['bias'],
        'authors': value['authors'] == null ? undefined : ((value['authors'] as Array<any>).map(AuthorToJSON)),
        'full_text': value['fullText'],
        'original_language_summary': value['originalLanguageSummary'],
        'image_description': value['imageDescription'],
        'as_string_key': value['asStringKey'],
    };
}

