/* tslint:disable */
/* eslint-disable */
/**
 * CWMS Data API
 * CWMS REST API for Data Retrieval
 *
 * The version of the OpenAPI document: 2.3.2-2025.03.19
 * 
 *
 * 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 { ForecastSpec } from './ForecastSpec';
import {
    ForecastSpecFromJSON,
    ForecastSpecFromJSONTyped,
    ForecastSpecToJSON,
} from './ForecastSpec';

/**
 * 
 * @export
 * @interface ForecastInstance
 */
export interface ForecastInstance {
    /**
     * 
     * @type {ForecastSpec}
     * @memberof ForecastInstance
     */
    spec?: ForecastSpec;
    /**
     * 
     * @type {Date}
     * @memberof ForecastInstance
     */
    dateTime?: Date;
    /**
     * 
     * @type {Date}
     * @memberof ForecastInstance
     */
    issueDateTime?: Date;
    /**
     * 
     * @type {Date}
     * @memberof ForecastInstance
     */
    firstDateTime?: Date;
    /**
     * 
     * @type {Date}
     * @memberof ForecastInstance
     */
    lastDateTime?: Date;
    /**
     * 
     * @type {number}
     * @memberof ForecastInstance
     */
    maxAge?: number;
    /**
     * Forecast Instance Notes
     * @type {string}
     * @memberof ForecastInstance
     */
    notes?: string;
    /**
     * 
     * @type {{ [key: string]: string; }}
     * @memberof ForecastInstance
     */
    metadata?: { [key: string]: string; };
    /**
     * Forecast Filename
     * @type {string}
     * @memberof ForecastInstance
     */
    filename?: string;
    /**
     * Description of Forecast File
     * @type {string}
     * @memberof ForecastInstance
     */
    fileDescription?: string;
    /**
     * Forecast File Media Type
     * @type {string}
     * @memberof ForecastInstance
     */
    fileMediaType?: string;
    /**
     * Forecast File binary data
     * @type {string}
     * @memberof ForecastInstance
     */
    fileData?: string;
    /**
     * Link to Forecast File binary data
     * @type {string}
     * @memberof ForecastInstance
     */
    fileDataUrl?: string;
}

/**
 * Check if a given object implements the ForecastInstance interface.
 */
export function instanceOfForecastInstance(value: object): boolean {
    return true;
}

export function ForecastInstanceFromJSON(json: any): ForecastInstance {
    return ForecastInstanceFromJSONTyped(json, false);
}

export function ForecastInstanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ForecastInstance {
    if (json == null) {
        return json;
    }
    return {
        
        'spec': json['spec'] == null ? undefined : ForecastSpecFromJSON(json['spec']),
        'dateTime': json['date-time'] == null ? undefined : (new Date(json['date-time'])),
        'issueDateTime': json['issue-date-time'] == null ? undefined : (new Date(json['issue-date-time'])),
        'firstDateTime': json['first-date-time'] == null ? undefined : (new Date(json['first-date-time'])),
        'lastDateTime': json['last-date-time'] == null ? undefined : (new Date(json['last-date-time'])),
        'maxAge': json['max-age'] == null ? undefined : json['max-age'],
        'notes': json['notes'] == null ? undefined : json['notes'],
        'metadata': json['metadata'] == null ? undefined : json['metadata'],
        'filename': json['filename'] == null ? undefined : json['filename'],
        'fileDescription': json['file-description'] == null ? undefined : json['file-description'],
        'fileMediaType': json['file-media-type'] == null ? undefined : json['file-media-type'],
        'fileData': json['file-data'] == null ? undefined : json['file-data'],
        'fileDataUrl': json['file-data-url'] == null ? undefined : json['file-data-url'],
    };
}

export function ForecastInstanceToJSON(value?: ForecastInstance | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'spec': ForecastSpecToJSON(value['spec']),
        'date-time': value['dateTime'] == null ? undefined : ((value['dateTime']).toISOString()),
        'issue-date-time': value['issueDateTime'] == null ? undefined : ((value['issueDateTime']).toISOString()),
        'first-date-time': value['firstDateTime'] == null ? undefined : ((value['firstDateTime']).toISOString()),
        'last-date-time': value['lastDateTime'] == null ? undefined : ((value['lastDateTime']).toISOString()),
        'max-age': value['maxAge'],
        'notes': value['notes'],
        'metadata': value['metadata'],
        'filename': value['filename'],
        'file-description': value['fileDescription'],
        'file-media-type': value['fileMediaType'],
        'file-data': value['fileData'],
        'file-data-url': value['fileDataUrl'],
    };
}

