UNPKG

cwmsjs

Version:

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

64 lines (63 loc) 2.92 kB
/* 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 { ForecastSpecFromJSON, ForecastSpecToJSON, } from './ForecastSpec'; /** * Check if a given object implements the ForecastInstance interface. */ export function instanceOfForecastInstance(value) { return true; } export function ForecastInstanceFromJSON(json) { return ForecastInstanceFromJSONTyped(json, false); } export function ForecastInstanceFromJSONTyped(json, ignoreDiscriminator) { 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) { 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'], }; }