cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
204 lines (194 loc) • 6.08 kB
text/typescript
/* 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.
*/
import { mapValues } from '../runtime';
import type { Location } from './Location';
import {
LocationFromJSON,
LocationFromJSONTyped,
LocationToJSON,
} from './Location';
/**
*
* @export
* @interface Project
*/
export interface Project {
/**
*
* @type {Location}
* @memberof Project
*/
location?: Location;
/**
*
* @type {number}
* @memberof Project
*/
federalCost?: number;
/**
*
* @type {number}
* @memberof Project
*/
nonFederalCost?: number;
/**
*
* @type {Date}
* @memberof Project
*/
costYear?: Date;
/**
*
* @type {string}
* @memberof Project
*/
costUnit?: string;
/**
*
* @type {number}
* @memberof Project
*/
federalOAndMCost?: number;
/**
*
* @type {number}
* @memberof Project
*/
nonFederalOAndMCost?: number;
/**
*
* @type {string}
* @memberof Project
*/
authorizingLaw?: string;
/**
*
* @type {string}
* @memberof Project
*/
projectOwner?: string;
/**
*
* @type {string}
* @memberof Project
*/
hydropowerDesc?: string;
/**
*
* @type {string}
* @memberof Project
*/
sedimentationDesc?: string;
/**
*
* @type {string}
* @memberof Project
*/
downstreamUrbanDesc?: string;
/**
*
* @type {string}
* @memberof Project
*/
bankFullCapacityDesc?: string;
/**
*
* @type {Location}
* @memberof Project
*/
pumpBackLocation?: Location;
/**
*
* @type {Location}
* @memberof Project
*/
nearGageLocation?: Location;
/**
*
* @type {Date}
* @memberof Project
*/
yieldTimeFrameStart?: Date;
/**
*
* @type {Date}
* @memberof Project
*/
yieldTimeFrameEnd?: Date;
/**
*
* @type {string}
* @memberof Project
*/
projectRemarks?: string;
}
/**
* Check if a given object implements the Project interface.
*/
export function instanceOfProject(value: object): boolean {
return true;
}
export function ProjectFromJSON(json: any): Project {
return ProjectFromJSONTyped(json, false);
}
export function ProjectFromJSONTyped(json: any, ignoreDiscriminator: boolean): Project {
if (json == null) {
return json;
}
return {
'location': json['location'] == null ? undefined : 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 : LocationFromJSON(json['pump-back-location']),
'nearGageLocation': json['near-gage-location'] == null ? undefined : 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'],
};
}
export function ProjectToJSON(value?: Project | null): any {
if (value == null) {
return value;
}
return {
'location': 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': LocationToJSON(value['pumpBackLocation']),
'near-gage-location': 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'],
};
}