/* 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 { ReadDomainResponse } from './ReadDomainResponse';
import {
    ReadDomainResponseFromJSON,
    ReadDomainResponseFromJSONTyped,
    ReadDomainResponseToJSON,
    ReadDomainResponseToJSONTyped,
} from './ReadDomainResponse';

/**
 * 
 * @export
 * @interface PaginatedResponseReadDomainResponse
 */
export interface PaginatedResponseReadDomainResponse {
    /**
     * 
     * @type {Array<ReadDomainResponse>}
     * @memberof PaginatedResponseReadDomainResponse
     */
    items: Array<ReadDomainResponse>;
    /**
     * 
     * @type {number}
     * @memberof PaginatedResponseReadDomainResponse
     */
    count: number;
    /**
     * 
     * @type {number}
     * @memberof PaginatedResponseReadDomainResponse
     */
    nextPage: number | null;
    /**
     * 
     * @type {number}
     * @memberof PaginatedResponseReadDomainResponse
     */
    previousPage: number | null;
}

/**
 * Check if a given object implements the PaginatedResponseReadDomainResponse interface.
 */
export function instanceOfPaginatedResponseReadDomainResponse(value: object): value is PaginatedResponseReadDomainResponse {
    if (!('items' in value) || value['items'] === undefined) return false;
    if (!('count' in value) || value['count'] === undefined) return false;
    if (!('nextPage' in value) || value['nextPage'] === undefined) return false;
    if (!('previousPage' in value) || value['previousPage'] === undefined) return false;
    return true;
}

export function PaginatedResponseReadDomainResponseFromJSON(json: any): PaginatedResponseReadDomainResponse {
    return PaginatedResponseReadDomainResponseFromJSONTyped(json, false);
}

export function PaginatedResponseReadDomainResponseFromJSONTyped(json: any, ignoreDiscriminator: boolean): PaginatedResponseReadDomainResponse {
    if (json == null) {
        return json;
    }
    return {
        
        'items': ((json['items'] as Array<any>).map(ReadDomainResponseFromJSON)),
        'count': json['count'],
        'nextPage': json['next_page'],
        'previousPage': json['previous_page'],
    };
}

export function PaginatedResponseReadDomainResponseToJSON(json: any): PaginatedResponseReadDomainResponse {
    return PaginatedResponseReadDomainResponseToJSONTyped(json, false);
}

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

    return {
        
        'items': ((value['items'] as Array<any>).map(ReadDomainResponseToJSON)),
        'count': value['count'],
        'next_page': value['nextPage'],
        'previous_page': value['previousPage'],
    };
}

