cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
77 lines (76 loc) • 4.36 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 Location_1 = require("./Location");
function ProjectFromJSON(json) {
return ProjectFromJSONTyped(json, false);
}
exports.ProjectFromJSON = ProjectFromJSON;
function ProjectFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'location': !runtime_1.exists(json, 'location') ? undefined : Location_1.LocationFromJSON(json['location']),
'federalCost': !runtime_1.exists(json, 'federal-cost') ? undefined : json['federal-cost'],
'nonFederalCost': !runtime_1.exists(json, 'non-federal-cost') ? undefined : json['non-federal-cost'],
'costYear': !runtime_1.exists(json, 'cost-year') ? undefined : (new Date(json['cost-year'])),
'costUnit': !runtime_1.exists(json, 'cost-unit') ? undefined : json['cost-unit'],
'federalOAndMCost': !runtime_1.exists(json, 'federal-o-and-m-cost') ? undefined : json['federal-o-and-m-cost'],
'nonFederalOAndMCost': !runtime_1.exists(json, 'non-federal-o-and-m-cost') ? undefined : json['non-federal-o-and-m-cost'],
'authorizingLaw': !runtime_1.exists(json, 'authorizing-law') ? undefined : json['authorizing-law'],
'projectOwner': !runtime_1.exists(json, 'project-owner') ? undefined : json['project-owner'],
'hydropowerDesc': !runtime_1.exists(json, 'hydropower-desc') ? undefined : json['hydropower-desc'],
'sedimentationDesc': !runtime_1.exists(json, 'sedimentation-desc') ? undefined : json['sedimentation-desc'],
'downstreamUrbanDesc': !runtime_1.exists(json, 'downstream-urban-desc') ? undefined : json['downstream-urban-desc'],
'bankFullCapacityDesc': !runtime_1.exists(json, 'bank-full-capacity-desc') ? undefined : json['bank-full-capacity-desc'],
'pumpBackLocation': !runtime_1.exists(json, 'pump-back-location') ? undefined : Location_1.LocationFromJSON(json['pump-back-location']),
'nearGageLocation': !runtime_1.exists(json, 'near-gage-location') ? undefined : Location_1.LocationFromJSON(json['near-gage-location']),
'yieldTimeFrameStart': !runtime_1.exists(json, 'yield-time-frame-start') ? undefined : (new Date(json['yield-time-frame-start'])),
'yieldTimeFrameEnd': !runtime_1.exists(json, 'yield-time-frame-end') ? undefined : (new Date(json['yield-time-frame-end'])),
'projectRemarks': !runtime_1.exists(json, 'project-remarks') ? undefined : json['project-remarks'],
};
}
exports.ProjectFromJSONTyped = ProjectFromJSONTyped;
function ProjectToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'location': Location_1.LocationToJSON(value.location),
'federal-cost': value.federalCost,
'non-federal-cost': value.nonFederalCost,
'cost-year': value.costYear === undefined ? undefined : (value.costYear.toISOString()),
'cost-unit': value.costUnit,
'federal-o-and-m-cost': value.federalOAndMCost,
'non-federal-o-and-m-cost': value.nonFederalOAndMCost,
'authorizing-law': value.authorizingLaw,
'project-owner': value.projectOwner,
'hydropower-desc': value.hydropowerDesc,
'sedimentation-desc': value.sedimentationDesc,
'downstream-urban-desc': value.downstreamUrbanDesc,
'bank-full-capacity-desc': value.bankFullCapacityDesc,
'pump-back-location': Location_1.LocationToJSON(value.pumpBackLocation),
'near-gage-location': Location_1.LocationToJSON(value.nearGageLocation),
'yield-time-frame-start': value.yieldTimeFrameStart === undefined ? undefined : (value.yieldTimeFrameStart.toISOString()),
'yield-time-frame-end': value.yieldTimeFrameEnd === undefined ? undefined : (value.yieldTimeFrameEnd.toISOString()),
'project-remarks': value.projectRemarks,
};
}
exports.ProjectToJSON = ProjectToJSON;