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