cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
67 lines (66 loc) • 2.96 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 CwmsId_1 = require("./CwmsId");
const ParameterInfo_1 = require("./ParameterInfo");
const _1 = require("./");
function TimeSeriesProfileParserFromJSON(json) {
return TimeSeriesProfileParserFromJSONTyped(json, false);
}
exports.TimeSeriesProfileParserFromJSON = TimeSeriesProfileParserFromJSON;
function TimeSeriesProfileParserFromJSONTyped(json, ignoreDiscriminator) {
if ((json === undefined) || (json === null)) {
return json;
}
if (!ignoreDiscriminator) {
if (json['type'] === 'TimeSeriesProfileParserColumnar') {
return _1.TimeSeriesProfileParserColumnarFromJSONTyped(json, true);
}
if (json['type'] === 'TimeSeriesProfileParserIndexed') {
return _1.TimeSeriesProfileParserIndexedFromJSONTyped(json, true);
}
}
return {
'locationId': !runtime_1.exists(json, 'location-id') ? undefined : CwmsId_1.CwmsIdFromJSON(json['location-id']),
'keyParameter': !runtime_1.exists(json, 'key-parameter') ? undefined : json['key-parameter'],
'recordDelimiter': !runtime_1.exists(json, 'record-delimiter') ? undefined : json['record-delimiter'],
'timeFormat': !runtime_1.exists(json, 'time-format') ? undefined : json['time-format'],
'timeZone': !runtime_1.exists(json, 'time-zone') ? undefined : json['time-zone'],
'parameterInfoList': !runtime_1.exists(json, 'parameter-info-list') ? undefined : (json['parameter-info-list'].map(ParameterInfo_1.ParameterInfoFromJSON)),
'timeInTwoFields': !runtime_1.exists(json, 'time-in-two-fields') ? undefined : json['time-in-two-fields'],
'type': !runtime_1.exists(json, 'type') ? undefined : json['type'],
};
}
exports.TimeSeriesProfileParserFromJSONTyped = TimeSeriesProfileParserFromJSONTyped;
function TimeSeriesProfileParserToJSON(value) {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'location-id': CwmsId_1.CwmsIdToJSON(value.locationId),
'key-parameter': value.keyParameter,
'record-delimiter': value.recordDelimiter,
'time-format': value.timeFormat,
'time-zone': value.timeZone,
'parameter-info-list': value.parameterInfoList === undefined ? undefined : (value.parameterInfoList.map(ParameterInfo_1.ParameterInfoToJSON)),
'time-in-two-fields': value.timeInTwoFields,
'type': value.type,
};
}
exports.TimeSeriesProfileParserToJSON = TimeSeriesProfileParserToJSON;