UNPKG

cwmsjs

Version:

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

65 lines (64 loc) 3.25 kB
"use strict"; /* 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. */ Object.defineProperty(exports, "__esModule", { value: true }); const runtime_1 = require("../runtime"); const VerticalDatumInfo_1 = require("./VerticalDatumInfo"); function UsgsStreamRatingFromJSON(json) { return UsgsStreamRatingFromJSONTyped(json, false); } exports.UsgsStreamRatingFromJSON = UsgsStreamRatingFromJSON; function UsgsStreamRatingFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'officeId': !runtime_1.exists(json, 'office-id') ? undefined : json['office-id'], 'ratingSpecId': !runtime_1.exists(json, 'rating-spec-id') ? undefined : json['rating-spec-id'], 'unitsId': !runtime_1.exists(json, 'units-id') ? undefined : json['units-id'], 'active': !runtime_1.exists(json, 'active') ? undefined : json['active'], 'effectiveDate': !runtime_1.exists(json, 'effective-date') ? undefined : (new Date(json['effective-date'])), 'createDate': !runtime_1.exists(json, 'create-date') ? undefined : (new Date(json['create-date'])), 'transitionDate': !runtime_1.exists(json, 'transition-date') ? undefined : (new Date(json['transition-date'])), 'description': !runtime_1.exists(json, 'description') ? undefined : json['description'], 'verticalDatumInfo': !runtime_1.exists(json, 'vertical-datum-info') ? undefined : VerticalDatumInfo_1.VerticalDatumInfoFromJSON(json['vertical-datum-info']), 'inRangeMethod': !runtime_1.exists(json, 'in-range-method') ? undefined : json['in-range-method'], 'outRangeLowMethod': !runtime_1.exists(json, 'out-range-low-method') ? undefined : json['out-range-low-method'], 'outRangeHighMethod': !runtime_1.exists(json, 'out-range-high-method') ? undefined : json['out-range-high-method'], }; } exports.UsgsStreamRatingFromJSONTyped = UsgsStreamRatingFromJSONTyped; function UsgsStreamRatingToJSON(value) { 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': VerticalDatumInfo_1.VerticalDatumInfoToJSON(value.verticalDatumInfo), 'in-range-method': value.inRangeMethod, 'out-range-low-method': value.outRangeLowMethod, 'out-range-high-method': value.outRangeHighMethod, }; } exports.UsgsStreamRatingToJSON = UsgsStreamRatingToJSON;