cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
73 lines (72 loc) • 3.36 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.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.EmbankmentToJSON = exports.EmbankmentFromJSONTyped = exports.EmbankmentFromJSON = exports.instanceOfEmbankment = void 0;
const CwmsId_1 = require("./CwmsId");
const Location_1 = require("./Location");
const LookupType_1 = require("./LookupType");
/**
* Check if a given object implements the Embankment interface.
*/
function instanceOfEmbankment(value) {
if (!('projectId' in value))
return false;
if (!('location' in value))
return false;
return true;
}
exports.instanceOfEmbankment = instanceOfEmbankment;
function EmbankmentFromJSON(json) {
return EmbankmentFromJSONTyped(json, false);
}
exports.EmbankmentFromJSON = EmbankmentFromJSON;
function EmbankmentFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'projectId': (0, CwmsId_1.CwmsIdFromJSON)(json['project-id']),
'location': (0, Location_1.LocationFromJSON)(json['location']),
'structureType': json['structure-type'] == null ? undefined : (0, LookupType_1.LookupTypeFromJSON)(json['structure-type']),
'upstreamSideSlope': json['upstream-side-slope'] == null ? undefined : json['upstream-side-slope'],
'downstreamSideSlope': json['downstream-side-slope'] == null ? undefined : json['downstream-side-slope'],
'structureLength': json['structure-length'] == null ? undefined : json['structure-length'],
'maxHeight': json['max-height'] == null ? undefined : json['max-height'],
'topWidth': json['top-width'] == null ? undefined : json['top-width'],
'lengthUnits': json['length-units'] == null ? undefined : json['length-units'],
'downstreamProtectionType': json['downstream-protection-type'] == null ? undefined : (0, LookupType_1.LookupTypeFromJSON)(json['downstream-protection-type']),
'upstreamProtectionType': json['upstream-protection-type'] == null ? undefined : (0, LookupType_1.LookupTypeFromJSON)(json['upstream-protection-type']),
};
}
exports.EmbankmentFromJSONTyped = EmbankmentFromJSONTyped;
function EmbankmentToJSON(value) {
if (value == null) {
return value;
}
return {
'project-id': (0, CwmsId_1.CwmsIdToJSON)(value['projectId']),
'location': (0, Location_1.LocationToJSON)(value['location']),
'structure-type': (0, LookupType_1.LookupTypeToJSON)(value['structureType']),
'upstream-side-slope': value['upstreamSideSlope'],
'downstream-side-slope': value['downstreamSideSlope'],
'structure-length': value['structureLength'],
'max-height': value['maxHeight'],
'top-width': value['topWidth'],
'length-units': value['lengthUnits'],
'downstream-protection-type': (0, LookupType_1.LookupTypeToJSON)(value['downstreamProtectionType']),
'upstream-protection-type': (0, LookupType_1.LookupTypeToJSON)(value['upstreamProtectionType']),
};
}
exports.EmbankmentToJSON = EmbankmentToJSON;