UNPKG

cwmsjs

Version:

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

66 lines (65 loc) 2.52 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.StreamReachToJSON = exports.StreamReachFromJSONTyped = exports.StreamReachFromJSON = exports.instanceOfStreamReach = void 0; const CwmsId_1 = require("./CwmsId"); const StreamLocationNode_1 = require("./StreamLocationNode"); /** * Check if a given object implements the StreamReach interface. */ function instanceOfStreamReach(value) { if (!('downstreamNode' in value)) return false; if (!('upstreamNode' in value)) return false; if (!('streamId' in value)) return false; if (!('id' in value)) return false; return true; } exports.instanceOfStreamReach = instanceOfStreamReach; function StreamReachFromJSON(json) { return StreamReachFromJSONTyped(json, false); } exports.StreamReachFromJSON = StreamReachFromJSON; function StreamReachFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'comment': json['comment'] == null ? undefined : json['comment'], 'downstreamNode': (0, StreamLocationNode_1.StreamLocationNodeFromJSON)(json['downstream-node']), 'upstreamNode': (0, StreamLocationNode_1.StreamLocationNodeFromJSON)(json['upstream-node']), 'configurationId': json['configuration-id'] == null ? undefined : (0, CwmsId_1.CwmsIdFromJSON)(json['configuration-id']), 'streamId': (0, CwmsId_1.CwmsIdFromJSON)(json['stream-id']), 'id': (0, CwmsId_1.CwmsIdFromJSON)(json['id']), }; } exports.StreamReachFromJSONTyped = StreamReachFromJSONTyped; function StreamReachToJSON(value) { if (value == null) { return value; } return { 'comment': value['comment'], 'downstream-node': (0, StreamLocationNode_1.StreamLocationNodeToJSON)(value['downstreamNode']), 'upstream-node': (0, StreamLocationNode_1.StreamLocationNodeToJSON)(value['upstreamNode']), 'configuration-id': (0, CwmsId_1.CwmsIdToJSON)(value['configurationId']), 'stream-id': (0, CwmsId_1.CwmsIdToJSON)(value['streamId']), 'id': (0, CwmsId_1.CwmsIdToJSON)(value['id']), }; } exports.StreamReachToJSON = StreamReachToJSON;