/* 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';
import type { NewsItemOut } from './NewsItemOut';
import {
    NewsItemOutFromJSON,
    NewsItemOutFromJSONTyped,
    NewsItemOutToJSON,
    NewsItemOutToJSONTyped,
} from './NewsItemOut';

/**
 * 
 * @export
 * @interface NewsListResponse
 */
export interface NewsListResponse {
    /**
     * 
     * @type {Array<NewsItemOut>}
     * @memberof NewsListResponse
     */
    items: Array<NewsItemOut>;
    /**
     * 
     * @type {number}
     * @memberof NewsListResponse
     */
    total: number;
    /**
     * 
     * @type {number}
     * @memberof NewsListResponse
     */
    offset: number;
}

/**
 * Check if a given object implements the NewsListResponse interface.
 */
export function instanceOfNewsListResponse(value: object): value is NewsListResponse {
    if (!('items' in value) || value['items'] === undefined) return false;
    if (!('total' in value) || value['total'] === undefined) return false;
    if (!('offset' in value) || value['offset'] === undefined) return false;
    return true;
}

export function NewsListResponseFromJSON(json: any): NewsListResponse {
    return NewsListResponseFromJSONTyped(json, false);
}

export function NewsListResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): NewsListResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'items': ((json['items'] as Array<any>).map(NewsItemOutFromJSON)),
        'total': json['total'],
        'offset': json['offset'],
    };
}

export function NewsListResponseToJSON(json: any): NewsListResponse {
    return NewsListResponseToJSONTyped(json, false);
}

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

    return {
        
        'items': ((value['items'] as Array<any>).map(NewsItemOutToJSON)),
        'total': value['total'],
        'offset': value['offset'],
    };
}

