/* 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 { ScrapeDataItem } from './ScrapeDataItem';
import {
    ScrapeDataItemFromJSON,
    ScrapeDataItemFromJSONTyped,
    ScrapeDataItemToJSON,
    ScrapeDataItemToJSONTyped,
} from './ScrapeDataItem';

/**
 * 
 * @export
 * @interface ScrapedURLItem
 */
export interface ScrapedURLItem {
    /**
     * 
     * @type {string}
     * @memberof ScrapedURLItem
     */
    url: string;
    /**
     * 
     * @type {ScrapeDataItem}
     * @memberof ScrapedURLItem
     */
    data?: ScrapeDataItem | null;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScrapedURLItem
     */
    metadata?: { [key: string]: any; } | null;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof ScrapedURLItem
     */
    enrichments?: { [key: string]: any; } | null;
}

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

export function ScrapedURLItemFromJSON(json: any): ScrapedURLItem {
    return ScrapedURLItemFromJSONTyped(json, false);
}

export function ScrapedURLItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): ScrapedURLItem {
    if (json == null) {
        return json;
    }
    return {
        
        'url': json['url'],
        'data': json['data'] == null ? undefined : ScrapeDataItemFromJSON(json['data']),
        'metadata': json['metadata'] == null ? undefined : json['metadata'],
        'enrichments': json['enrichments'] == null ? undefined : json['enrichments'],
    };
}

export function ScrapedURLItemToJSON(json: any): ScrapedURLItem {
    return ScrapedURLItemToJSONTyped(json, false);
}

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

    return {
        
        'url': value['url'],
        'data': ScrapeDataItemToJSON(value['data']),
        'metadata': value['metadata'],
        'enrichments': value['enrichments'],
    };
}

