UNPKG

cwmsjs

Version:

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

66 lines (65 loc) 2.67 kB
"use strict"; /* 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. */ Object.defineProperty(exports, "__esModule", { value: true }); exports.StreamToJSON = exports.StreamFromJSONTyped = exports.StreamFromJSON = exports.instanceOfStream = void 0; const CwmsId_1 = require("./CwmsId"); const StreamNode_1 = require("./StreamNode"); /** * Check if a given object implements the Stream interface. */ function instanceOfStream(value) { if (!('id' in value)) return false; return true; } exports.instanceOfStream = instanceOfStream; function StreamFromJSON(json) { return StreamFromJSONTyped(json, false); } exports.StreamFromJSON = StreamFromJSON; function StreamFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'startsDownstream': json['starts-downstream'] == null ? undefined : json['starts-downstream'], 'flowsIntoStreamNode': json['flows-into-stream-node'] == null ? undefined : (0, StreamNode_1.StreamNodeFromJSON)(json['flows-into-stream-node']), 'divertsFromStreamNode': json['diverts-from-stream-node'] == null ? undefined : (0, StreamNode_1.StreamNodeFromJSON)(json['diverts-from-stream-node']), 'length': json['length'] == null ? undefined : json['length'], 'averageSlope': json['average-slope'] == null ? undefined : json['average-slope'], 'lengthUnits': json['length-units'] == null ? undefined : json['length-units'], 'slopeUnits': json['slope-units'] == null ? undefined : json['slope-units'], 'comment': json['comment'] == null ? undefined : json['comment'], 'id': (0, CwmsId_1.CwmsIdFromJSON)(json['id']), }; } exports.StreamFromJSONTyped = StreamFromJSONTyped; function StreamToJSON(value) { if (value == null) { return value; } return { 'starts-downstream': value['startsDownstream'], 'flows-into-stream-node': (0, StreamNode_1.StreamNodeToJSON)(value['flowsIntoStreamNode']), 'diverts-from-stream-node': (0, StreamNode_1.StreamNodeToJSON)(value['divertsFromStreamNode']), 'length': value['length'], 'average-slope': value['averageSlope'], 'length-units': value['lengthUnits'], 'slope-units': value['slopeUnits'], 'comment': value['comment'], 'id': (0, CwmsId_1.CwmsIdToJSON)(value['id']), }; } exports.StreamToJSON = StreamToJSON;