cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
80 lines (79 loc) • 4.89 kB
JavaScript
;
/* 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 CwmsId_1 = require("./CwmsId");
const Location_1 = require("./Location");
const LockLocationLevelRef_1 = require("./LockLocationLevelRef");
const LookupType_1 = require("./LookupType");
function LockFromJSON(json) {
return LockFromJSONTyped(json, false);
}
exports.LockFromJSON = LockFromJSON;
function LockFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'projectId': CwmsId_1.CwmsIdFromJSON(json['project-id']),
'location': Location_1.LocationFromJSON(json['location']),
'chamberType': !runtime_1.exists(json, 'chamber-type') ? undefined : LookupType_1.LookupTypeFromJSON(json['chamber-type']),
'lockWidth': !runtime_1.exists(json, 'lock-width') ? undefined : json['lock-width'],
'lockLength': !runtime_1.exists(json, 'lock-length') ? undefined : json['lock-length'],
'normalLockLift': !runtime_1.exists(json, 'normal-lock-lift') ? undefined : json['normal-lock-lift'],
'maximumLockLift': !runtime_1.exists(json, 'maximum-lock-lift') ? undefined : json['maximum-lock-lift'],
'lengthUnits': !runtime_1.exists(json, 'length-units') ? undefined : json['length-units'],
'volumeUnits': !runtime_1.exists(json, 'volume-units') ? undefined : json['volume-units'],
'volumePerLockage': !runtime_1.exists(json, 'volume-per-lockage') ? undefined : json['volume-per-lockage'],
'minimumDraft': !runtime_1.exists(json, 'minimum-draft') ? undefined : json['minimum-draft'],
'highWaterUpperPoolLocationLevel': !runtime_1.exists(json, 'high-water-upper-pool-location-level') ? undefined : LockLocationLevelRef_1.LockLocationLevelRefFromJSON(json['high-water-upper-pool-location-level']),
'lowWaterLowerPoolLocationLevel': !runtime_1.exists(json, 'low-water-lower-pool-location-level') ? undefined : LockLocationLevelRef_1.LockLocationLevelRefFromJSON(json['low-water-lower-pool-location-level']),
'highWaterLowerPoolLocationLevel': !runtime_1.exists(json, 'high-water-lower-pool-location-level') ? undefined : LockLocationLevelRef_1.LockLocationLevelRefFromJSON(json['high-water-lower-pool-location-level']),
'lowWaterUpperPoolLocationLevel': !runtime_1.exists(json, 'low-water-upper-pool-location-level') ? undefined : LockLocationLevelRef_1.LockLocationLevelRefFromJSON(json['low-water-upper-pool-location-level']),
'highWaterUpperPoolWarningLevel': !runtime_1.exists(json, 'high-water-upper-pool-warning-level') ? undefined : json['high-water-upper-pool-warning-level'],
'highWaterLowerPoolWarningLevel': !runtime_1.exists(json, 'high-water-lower-pool-warning-level') ? undefined : json['high-water-lower-pool-warning-level'],
'elevationUnits': !runtime_1.exists(json, 'elevation-units') ? undefined : json['elevation-units'],
};
}
exports.LockFromJSONTyped = LockFromJSONTyped;
function LockToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'project-id': CwmsId_1.CwmsIdToJSON(value.projectId),
'location': Location_1.LocationToJSON(value.location),
'chamber-type': LookupType_1.LookupTypeToJSON(value.chamberType),
'lock-width': value.lockWidth,
'lock-length': value.lockLength,
'normal-lock-lift': value.normalLockLift,
'maximum-lock-lift': value.maximumLockLift,
'length-units': value.lengthUnits,
'volume-units': value.volumeUnits,
'volume-per-lockage': value.volumePerLockage,
'minimum-draft': value.minimumDraft,
'high-water-upper-pool-location-level': LockLocationLevelRef_1.LockLocationLevelRefToJSON(value.highWaterUpperPoolLocationLevel),
'low-water-lower-pool-location-level': LockLocationLevelRef_1.LockLocationLevelRefToJSON(value.lowWaterLowerPoolLocationLevel),
'high-water-lower-pool-location-level': LockLocationLevelRef_1.LockLocationLevelRefToJSON(value.highWaterLowerPoolLocationLevel),
'low-water-upper-pool-location-level': LockLocationLevelRef_1.LockLocationLevelRefToJSON(value.lowWaterUpperPoolLocationLevel),
'high-water-upper-pool-warning-level': value.highWaterUpperPoolWarningLevel,
'high-water-lower-pool-warning-level': value.highWaterLowerPoolWarningLevel,
'elevation-units': value.elevationUnits,
};
}
exports.LockToJSON = LockToJSON;