cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
96 lines (87 loc) • 2.17 kB
text/typescript
/* 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.
*/
import { exists, mapValues } from '../runtime';
import {
TsvId,
TsvIdFromJSON,
TsvIdFromJSONTyped,
TsvIdToJSON,
} from './TsvId';
/**
*
* @export
* @interface Tsv
*/
export interface Tsv {
/**
*
* @type {TsvId}
* @memberof Tsv
*/
id?: TsvId;
/**
*
* @type {number}
* @memberof Tsv
*/
value?: number;
/**
*
* @type {number}
* @memberof Tsv
*/
qualityCode?: number;
/**
*
* @type {Date}
* @memberof Tsv
*/
startDate?: Date;
/**
*
* @type {Date}
* @memberof Tsv
*/
endDate?: Date;
}
export function TsvFromJSON(json: any): Tsv {
return TsvFromJSONTyped(json, false);
}
export function TsvFromJSONTyped(json: any, ignoreDiscriminator: boolean): Tsv {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'id': !exists(json, 'id') ? undefined : TsvIdFromJSON(json['id']),
'value': !exists(json, 'value') ? undefined : json['value'],
'qualityCode': !exists(json, 'qualityCode') ? undefined : json['qualityCode'],
'startDate': !exists(json, 'startDate') ? undefined : (new Date(json['startDate'])),
'endDate': !exists(json, 'endDate') ? undefined : (new Date(json['endDate'])),
};
}
export function TsvToJSON(value?: Tsv | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'id': TsvIdToJSON(value.id),
'value': value.value,
'qualityCode': value.qualityCode,
'startDate': value.startDate === undefined ? undefined : (value.startDate.toISOString()),
'endDate': value.endDate === undefined ? undefined : (value.endDate.toISOString()),
};
}