UNPKG

cwmsjs

Version:

CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps

51 lines (50 loc) 1.76 kB
"use strict"; /* 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 TsvId_1 = require("./TsvId"); function TsvFromJSON(json) { return TsvFromJSONTyped(json, false); } exports.TsvFromJSON = TsvFromJSON; function TsvFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'id': !runtime_1.exists(json, 'id') ? undefined : TsvId_1.TsvIdFromJSON(json['id']), 'value': !runtime_1.exists(json, 'value') ? undefined : json['value'], 'qualityCode': !runtime_1.exists(json, 'qualityCode') ? undefined : json['qualityCode'], 'startDate': !runtime_1.exists(json, 'startDate') ? undefined : (new Date(json['startDate'])), 'endDate': !runtime_1.exists(json, 'endDate') ? undefined : (new Date(json['endDate'])), }; } exports.TsvFromJSONTyped = TsvFromJSONTyped; function TsvToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'id': TsvId_1.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()), }; } exports.TsvToJSON = TsvToJSON;