cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
59 lines (58 loc) • 2.28 kB
JavaScript
/* 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 { CwmsIdFromJSON, CwmsIdToJSON, } from './CwmsId';
import { StreamNodeFromJSON, StreamNodeToJSON, } from './StreamNode';
/**
* Check if a given object implements the Stream interface.
*/
export function instanceOfStream(value) {
if (!('id' in value))
return false;
return true;
}
export function StreamFromJSON(json) {
return StreamFromJSONTyped(json, false);
}
export 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 : StreamNodeFromJSON(json['flows-into-stream-node']),
'divertsFromStreamNode': json['diverts-from-stream-node'] == null ? undefined : 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': CwmsIdFromJSON(json['id']),
};
}
export function StreamToJSON(value) {
if (value == null) {
return value;
}
return {
'starts-downstream': value['startsDownstream'],
'flows-into-stream-node': StreamNodeToJSON(value['flowsIntoStreamNode']),
'diverts-from-stream-node': StreamNodeToJSON(value['divertsFromStreamNode']),
'length': value['length'],
'average-slope': value['averageSlope'],
'length-units': value['lengthUnits'],
'slope-units': value['slopeUnits'],
'comment': value['comment'],
'id': CwmsIdToJSON(value['id']),
};
}