UNPKG

cwmsjs

Version:

CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps

160 lines (151 loc) 4.69 kB
/* tslint:disable */ /* eslint-disable */ /** * CWMS Data API * CWMS REST API for Data Retrieval * * The version of the OpenAPI document: 2.4.0-2026.3.16 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { exists, mapValues } from '../runtime'; import { ForecastSpec, 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; } export function ForecastInstanceFromJSON(json: any): ForecastInstance { return ForecastInstanceFromJSONTyped(json, false); } export function ForecastInstanceFromJSONTyped(json: any, ignoreDiscriminator: boolean): ForecastInstance { if ((json === undefined) || (json === null)) { return json; } return { 'spec': !exists(json, 'spec') ? undefined : ForecastSpecFromJSON(json['spec']), 'dateTime': !exists(json, 'date-time') ? undefined : (new Date(json['date-time'])), 'issueDateTime': !exists(json, 'issue-date-time') ? undefined : (new Date(json['issue-date-time'])), 'firstDateTime': !exists(json, 'first-date-time') ? undefined : (new Date(json['first-date-time'])), 'lastDateTime': !exists(json, 'last-date-time') ? undefined : (new Date(json['last-date-time'])), 'maxAge': !exists(json, 'max-age') ? undefined : json['max-age'], 'notes': !exists(json, 'notes') ? undefined : json['notes'], 'metadata': !exists(json, 'metadata') ? undefined : json['metadata'], 'filename': !exists(json, 'filename') ? undefined : json['filename'], 'fileDescription': !exists(json, 'file-description') ? undefined : json['file-description'], 'fileMediaType': !exists(json, 'file-media-type') ? undefined : json['file-media-type'], 'fileData': !exists(json, 'file-data') ? undefined : json['file-data'], 'fileDataUrl': !exists(json, 'file-data-url') ? undefined : json['file-data-url'], }; } export function ForecastInstanceToJSON(value?: ForecastInstance | null): any { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'spec': ForecastSpecToJSON(value.spec), 'date-time': value.dateTime === undefined ? undefined : (value.dateTime.toISOString()), 'issue-date-time': value.issueDateTime === undefined ? undefined : (value.issueDateTime.toISOString()), 'first-date-time': value.firstDateTime === undefined ? undefined : (value.firstDateTime.toISOString()), 'last-date-time': value.lastDateTime === undefined ? 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, }; }