cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
158 lines (149 loc) • 4.58 kB
text/typescript
/* 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.
*/
import { exists, mapValues } from '../runtime';
import {
TableRating,
TableRatingFromJSON,
TableRatingFromJSONTyped,
TableRatingToJSON,
} from './TableRating';
import {
VerticalDatumInfo,
VerticalDatumInfoFromJSON,
VerticalDatumInfoFromJSONTyped,
VerticalDatumInfoToJSON,
} from './VerticalDatumInfo';
/**
*
* @export
* @interface UsgsStreamRating
*/
export interface UsgsStreamRating {
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
officeId?: string;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
ratingSpecId?: string;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
unitsId?: string;
/**
*
* @type {boolean}
* @memberof UsgsStreamRating
*/
active?: boolean;
/**
*
* @type {Date}
* @memberof UsgsStreamRating
*/
effectiveDate?: Date;
/**
*
* @type {Date}
* @memberof UsgsStreamRating
*/
createDate?: Date;
/**
*
* @type {Date}
* @memberof UsgsStreamRating
*/
transitionDate?: Date;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
description?: string;
/**
*
* @type {VerticalDatumInfo}
* @memberof UsgsStreamRating
*/
verticalDatumInfo?: VerticalDatumInfo;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
inRangeMethod?: string;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
outRangeLowMethod?: string;
/**
*
* @type {string}
* @memberof UsgsStreamRating
*/
outRangeHighMethod?: string;
}
export function UsgsStreamRatingFromJSON(json: any): UsgsStreamRating {
return UsgsStreamRatingFromJSONTyped(json, false);
}
export function UsgsStreamRatingFromJSONTyped(json: any, ignoreDiscriminator: boolean): UsgsStreamRating {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'officeId': !exists(json, 'office-id') ? undefined : json['office-id'],
'ratingSpecId': !exists(json, 'rating-spec-id') ? undefined : json['rating-spec-id'],
'unitsId': !exists(json, 'units-id') ? undefined : json['units-id'],
'active': !exists(json, 'active') ? undefined : json['active'],
'effectiveDate': !exists(json, 'effective-date') ? undefined : (new Date(json['effective-date'])),
'createDate': !exists(json, 'create-date') ? undefined : (new Date(json['create-date'])),
'transitionDate': !exists(json, 'transition-date') ? undefined : (new Date(json['transition-date'])),
'description': !exists(json, 'description') ? undefined : json['description'],
'verticalDatumInfo': !exists(json, 'vertical-datum-info') ? undefined : VerticalDatumInfoFromJSON(json['vertical-datum-info']),
'inRangeMethod': !exists(json, 'in-range-method') ? undefined : json['in-range-method'],
'outRangeLowMethod': !exists(json, 'out-range-low-method') ? undefined : json['out-range-low-method'],
'outRangeHighMethod': !exists(json, 'out-range-high-method') ? undefined : json['out-range-high-method'],
};
}
export function UsgsStreamRatingToJSON(value?: UsgsStreamRating | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'office-id': value.officeId,
'rating-spec-id': value.ratingSpecId,
'units-id': value.unitsId,
'active': value.active,
'effective-date': value.effectiveDate === undefined ? undefined : (value.effectiveDate.toISOString()),
'create-date': value.createDate === undefined ? undefined : (value.createDate.toISOString()),
'transition-date': value.transitionDate === undefined ? undefined : (value.transitionDate.toISOString()),
'description': value.description,
'vertical-datum-info': VerticalDatumInfoToJSON(value.verticalDatumInfo),
'in-range-method': value.inRangeMethod,
'out-range-low-method': value.outRangeLowMethod,
'out-range-high-method': value.outRangeHighMethod,
};
}