cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
139 lines (129 loc) • 4 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 {
CwmsId,
CwmsIdFromJSON,
CwmsIdFromJSONTyped,
CwmsIdToJSON,
} from './CwmsId';
import {
ParameterInfo,
ParameterInfoFromJSON,
ParameterInfoFromJSONTyped,
ParameterInfoToJSON,
} from './ParameterInfo';
import {
TimeSeriesProfileParserColumnarFromJSONTyped,
TimeSeriesProfileParserIndexedFromJSONTyped
} from './';
/**
*
* @export
* @interface TimeSeriesProfileParser
*/
export interface TimeSeriesProfileParser {
/**
*
* @type {CwmsId}
* @memberof TimeSeriesProfileParser
*/
locationId?: CwmsId;
/**
*
* @type {string}
* @memberof TimeSeriesProfileParser
*/
keyParameter?: string;
/**
*
* @type {string}
* @memberof TimeSeriesProfileParser
*/
recordDelimiter?: string;
/**
*
* @type {string}
* @memberof TimeSeriesProfileParser
*/
timeFormat?: string;
/**
*
* @type {string}
* @memberof TimeSeriesProfileParser
*/
timeZone?: string;
/**
*
* @type {Array<ParameterInfo>}
* @memberof TimeSeriesProfileParser
*/
parameterInfoList?: Array<ParameterInfo>;
/**
*
* @type {boolean}
* @memberof TimeSeriesProfileParser
*/
timeInTwoFields?: boolean;
/**
*
* @type {string}
* @memberof TimeSeriesProfileParser
*/
type?: string;
}
export function TimeSeriesProfileParserFromJSON(json: any): TimeSeriesProfileParser {
return TimeSeriesProfileParserFromJSONTyped(json, false);
}
export function TimeSeriesProfileParserFromJSONTyped(json: any, ignoreDiscriminator: boolean): TimeSeriesProfileParser {
if ((json === undefined) || (json === null)) {
return json;
}
if (!ignoreDiscriminator) {
if (json['type'] === 'TimeSeriesProfileParserColumnar') {
return TimeSeriesProfileParserColumnarFromJSONTyped(json, true);
}
if (json['type'] === 'TimeSeriesProfileParserIndexed') {
return TimeSeriesProfileParserIndexedFromJSONTyped(json, true);
}
}
return {
'locationId': !exists(json, 'location-id') ? undefined : CwmsIdFromJSON(json['location-id']),
'keyParameter': !exists(json, 'key-parameter') ? undefined : json['key-parameter'],
'recordDelimiter': !exists(json, 'record-delimiter') ? undefined : json['record-delimiter'],
'timeFormat': !exists(json, 'time-format') ? undefined : json['time-format'],
'timeZone': !exists(json, 'time-zone') ? undefined : json['time-zone'],
'parameterInfoList': !exists(json, 'parameter-info-list') ? undefined : ((json['parameter-info-list'] as Array<any>).map(ParameterInfoFromJSON)),
'timeInTwoFields': !exists(json, 'time-in-two-fields') ? undefined : json['time-in-two-fields'],
'type': !exists(json, 'type') ? undefined : json['type'],
};
}
export function TimeSeriesProfileParserToJSON(value?: TimeSeriesProfileParser | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'location-id': 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 as Array<any>).map(ParameterInfoToJSON)),
'time-in-two-fields': value.timeInTwoFields,
'type': value.type,
};
}