/* tslint:disable */
/* eslint-disable */
/**
 * RMI Backend
 * Rug Munch Intelligence — institutional-grade crypto intelligence API. 13+ chains, 96 data providers, 8 MCP tools, x402 paid tier, sovereign-first FOSS.
 *
 * The version of the OpenAPI document: 2026.06.21
 * 
 *
 * 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';
/**
 * 
 * @export
 * @interface NewsItemOut
 */
export interface NewsItemOut {
    /**
     * 
     * @type {string}
     * @memberof NewsItemOut
     */
    newsId?: string | null;
    /**
     * 
     * @type {string}
     * @memberof NewsItemOut
     */
    url?: string | null;
    /**
     * 
     * @type {string}
     * @memberof NewsItemOut
     */
    title?: string | null;
    /**
     * 
     * @type {string}
     * @memberof NewsItemOut
     */
    summary?: string | null;
    /**
     * 
     * @type {string}
     * @memberof NewsItemOut
     */
    source?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof NewsItemOut
     */
    publishedAt?: Date | null;
    /**
     * 
     * @type {Array<string>}
     * @memberof NewsItemOut
     */
    chainsMentioned?: Array<string>;
    /**
     * 
     * @type {Array<string>}
     * @memberof NewsItemOut
     */
    tokensMentioned?: Array<string>;
    /**
     * 
     * @type {number}
     * @memberof NewsItemOut
     */
    sentimentScore?: number | null;
    /**
     * 
     * @type {number}
     * @memberof NewsItemOut
     */
    score?: number | null;
}

/**
 * Check if a given object implements the NewsItemOut interface.
 */
export function instanceOfNewsItemOut(value: object): value is NewsItemOut {
    return true;
}

export function NewsItemOutFromJSON(json: any): NewsItemOut {
    return NewsItemOutFromJSONTyped(json, false);
}

export function NewsItemOutFromJSONTyped(json: any, ignoreDiscriminator: boolean): NewsItemOut {
    if (json == null) {
        return json;
    }
    return {
        
        'newsId': json['news_id'] == null ? undefined : json['news_id'],
        'url': json['url'] == null ? undefined : json['url'],
        'title': json['title'] == null ? undefined : json['title'],
        'summary': json['summary'] == null ? undefined : json['summary'],
        'source': json['source'] == null ? undefined : json['source'],
        'publishedAt': json['published_at'] == null ? undefined : (new Date(json['published_at'])),
        'chainsMentioned': json['chains_mentioned'] == null ? undefined : json['chains_mentioned'],
        'tokensMentioned': json['tokens_mentioned'] == null ? undefined : json['tokens_mentioned'],
        'sentimentScore': json['sentiment_score'] == null ? undefined : json['sentiment_score'],
        'score': json['score'] == null ? undefined : json['score'],
    };
}

export function NewsItemOutToJSON(json: any): NewsItemOut {
    return NewsItemOutToJSONTyped(json, false);
}

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

    return {
        
        'news_id': value['newsId'],
        'url': value['url'],
        'title': value['title'],
        'summary': value['summary'],
        'source': value['source'],
        'published_at': value['publishedAt'] == null ? value['publishedAt'] : value['publishedAt'].toISOString(),
        'chains_mentioned': value['chainsMentioned'],
        'tokens_mentioned': value['tokensMentioned'],
        'sentiment_score': value['sentimentScore'],
        'score': value['score'],
    };
}

