cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
67 lines (66 loc) • 3.26 kB
JavaScript
;
/* 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const runtime_1 = require("../runtime");
const ForecastSpec_1 = require("./ForecastSpec");
function ForecastInstanceFromJSON(json) {
return ForecastInstanceFromJSONTyped(json, false);
}
exports.ForecastInstanceFromJSON = ForecastInstanceFromJSON;
function ForecastInstanceFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'spec': !runtime_1.exists(json, 'spec') ? undefined : ForecastSpec_1.ForecastSpecFromJSON(json['spec']),
'dateTime': !runtime_1.exists(json, 'date-time') ? undefined : (new Date(json['date-time'])),
'issueDateTime': !runtime_1.exists(json, 'issue-date-time') ? undefined : (new Date(json['issue-date-time'])),
'firstDateTime': !runtime_1.exists(json, 'first-date-time') ? undefined : (new Date(json['first-date-time'])),
'lastDateTime': !runtime_1.exists(json, 'last-date-time') ? undefined : (new Date(json['last-date-time'])),
'maxAge': !runtime_1.exists(json, 'max-age') ? undefined : json['max-age'],
'notes': !runtime_1.exists(json, 'notes') ? undefined : json['notes'],
'metadata': !runtime_1.exists(json, 'metadata') ? undefined : json['metadata'],
'filename': !runtime_1.exists(json, 'filename') ? undefined : json['filename'],
'fileDescription': !runtime_1.exists(json, 'file-description') ? undefined : json['file-description'],
'fileMediaType': !runtime_1.exists(json, 'file-media-type') ? undefined : json['file-media-type'],
'fileData': !runtime_1.exists(json, 'file-data') ? undefined : json['file-data'],
'fileDataUrl': !runtime_1.exists(json, 'file-data-url') ? undefined : json['file-data-url'],
};
}
exports.ForecastInstanceFromJSONTyped = ForecastInstanceFromJSONTyped;
function ForecastInstanceToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'spec': ForecastSpec_1.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,
};
}
exports.ForecastInstanceToJSON = ForecastInstanceToJSON;