cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
59 lines (58 loc) • 1.99 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 { StreamLocationNodeFromJSON, StreamLocationNodeToJSON, } from './StreamLocationNode';
/**
* Check if a given object implements the StreamReach interface.
*/
export 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;
}
export function StreamReachFromJSON(json) {
return StreamReachFromJSONTyped(json, false);
}
export function StreamReachFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'comment': json['comment'] == null ? undefined : json['comment'],
'downstreamNode': StreamLocationNodeFromJSON(json['downstream-node']),
'upstreamNode': StreamLocationNodeFromJSON(json['upstream-node']),
'configurationId': json['configuration-id'] == null ? undefined : CwmsIdFromJSON(json['configuration-id']),
'streamId': CwmsIdFromJSON(json['stream-id']),
'id': CwmsIdFromJSON(json['id']),
};
}
export function StreamReachToJSON(value) {
if (value == null) {
return value;
}
return {
'comment': value['comment'],
'downstream-node': StreamLocationNodeToJSON(value['downstreamNode']),
'upstream-node': StreamLocationNodeToJSON(value['upstreamNode']),
'configuration-id': CwmsIdToJSON(value['configurationId']),
'stream-id': CwmsIdToJSON(value['streamId']),
'id': CwmsIdToJSON(value['id']),
};
}