UNPKG

cwmsjs

Version:

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

60 lines (59 loc) 2.5 kB
"use strict"; /* 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 CwmsId_1 = require("./CwmsId"); const StreamNode_1 = require("./StreamNode"); function StreamFromJSON(json) { return StreamFromJSONTyped(json, false); } exports.StreamFromJSON = StreamFromJSON; function StreamFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'startsDownstream': !runtime_1.exists(json, 'starts-downstream') ? undefined : json['starts-downstream'], 'flowsIntoStreamNode': !runtime_1.exists(json, 'flows-into-stream-node') ? undefined : StreamNode_1.StreamNodeFromJSON(json['flows-into-stream-node']), 'divertsFromStreamNode': !runtime_1.exists(json, 'diverts-from-stream-node') ? undefined : StreamNode_1.StreamNodeFromJSON(json['diverts-from-stream-node']), 'length': !runtime_1.exists(json, 'length') ? undefined : json['length'], 'averageSlope': !runtime_1.exists(json, 'average-slope') ? undefined : json['average-slope'], 'lengthUnits': !runtime_1.exists(json, 'length-units') ? undefined : json['length-units'], 'slopeUnits': !runtime_1.exists(json, 'slope-units') ? undefined : json['slope-units'], 'comment': !runtime_1.exists(json, 'comment') ? undefined : json['comment'], 'id': CwmsId_1.CwmsIdFromJSON(json['id']), }; } exports.StreamFromJSONTyped = StreamFromJSONTyped; function StreamToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'starts-downstream': value.startsDownstream, 'flows-into-stream-node': StreamNode_1.StreamNodeToJSON(value.flowsIntoStreamNode), 'diverts-from-stream-node': StreamNode_1.StreamNodeToJSON(value.divertsFromStreamNode), 'length': value.length, 'average-slope': value.averageSlope, 'length-units': value.lengthUnits, 'slope-units': value.slopeUnits, 'comment': value.comment, 'id': CwmsId_1.CwmsIdToJSON(value.id), }; } exports.StreamToJSON = StreamToJSON;