cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
241 lines (231 loc) • 7.83 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 {
Alias,
AliasFromJSON,
AliasFromJSONTyped,
AliasToJSON,
} from './Alias';
import {
RATING,
RATINGFromJSON,
RATINGFromJSONTyped,
RATINGToJSON,
} from './RATING';
/**
*
* @export
* @interface VirtualLocationLevel
*/
export interface VirtualLocationLevel {
/**
* Owning office of object.
* @type {string}
* @memberof VirtualLocationLevel
*/
officeId: string;
/**
* Name of the location level
* @type {string}
* @memberof VirtualLocationLevel
*/
locationLevelId: string;
/**
* TimeSeries ID (e.g. from the times series catalog) to use as the location level. Mutually exclusive with seasonalValues and siParameterUnitsConstantValue
* @type {string}
* @memberof VirtualLocationLevel
*/
specifiedLevelId?: string;
/**
* The expiration date of the location level.
* @type {Date}
* @memberof VirtualLocationLevel
*/
expirationDate?: Date;
/**
* Data Type such as Stage, Elevation, or others.
* @type {string}
* @memberof VirtualLocationLevel
*/
parameterId?: string;
/**
* To indicate if single or aggregate value
* @type {string}
* @memberof VirtualLocationLevel
*/
parameterTypeId?: VirtualLocationLevelParameterTypeIdEnum;
/**
* Indicating whether or not to interpolate between seasonal values.
* @type {string}
* @memberof VirtualLocationLevel
*/
interpolateString?: VirtualLocationLevelInterpolateStringEnum;
/**
* Units the provided levels are in
* @type {string}
* @memberof VirtualLocationLevel
*/
levelUnitsId?: string;
/**
* The date/time at which this location level configuration takes effect.
* @type {Date}
* @memberof VirtualLocationLevel
*/
levelDate?: Date;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
levelComment?: string;
/**
* 0 if parameterTypeId is Inst. Otherwise duration indicating the time window of the aggregate value.
* @type {string}
* @memberof VirtualLocationLevel
*/
durationId?: string;
/**
*
* @type {number}
* @memberof VirtualLocationLevel
*/
attributeValue?: number;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
attributeUnitsId?: string;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
attributeParameterTypeId?: string;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
attributeParameterId?: string;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
attributeDurationId?: string;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
attributeComment?: string;
/**
*
* @type {Array<Alias>}
* @memberof VirtualLocationLevel
*/
aliases?: Array<Alias>;
/**
*
* @type {Array<RATING>}
* @memberof VirtualLocationLevel
*/
constituents?: Array<RATING>;
/**
*
* @type {string}
* @memberof VirtualLocationLevel
*/
constituentConnections?: string;
}
/**
* @export
* @enum {string}
*/
export enum VirtualLocationLevelParameterTypeIdEnum {
Inst = 'Inst',
Ave = 'Ave',
Min = 'Min',
Max = 'Max',
Total = 'Total'
}/**
* @export
* @enum {string}
*/
export enum VirtualLocationLevelInterpolateStringEnum {
T = 'T',
F = 'F'
}
export function VirtualLocationLevelFromJSON(json: any): VirtualLocationLevel {
return VirtualLocationLevelFromJSONTyped(json, false);
}
export function VirtualLocationLevelFromJSONTyped(json: any, ignoreDiscriminator: boolean): VirtualLocationLevel {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'officeId': json['office-id'],
'locationLevelId': json['location-level-id'],
'specifiedLevelId': !exists(json, 'specified-level-id') ? undefined : json['specified-level-id'],
'expirationDate': !exists(json, 'expiration-date') ? undefined : (new Date(json['expiration-date'])),
'parameterId': !exists(json, 'parameter-id') ? undefined : json['parameter-id'],
'parameterTypeId': !exists(json, 'parameter-type-id') ? undefined : json['parameter-type-id'],
'interpolateString': !exists(json, 'interpolate-string') ? undefined : json['interpolate-string'],
'levelUnitsId': !exists(json, 'level-units-id') ? undefined : json['level-units-id'],
'levelDate': !exists(json, 'level-date') ? undefined : (new Date(json['level-date'])),
'levelComment': !exists(json, 'level-comment') ? undefined : json['level-comment'],
'durationId': !exists(json, 'duration-id') ? undefined : json['duration-id'],
'attributeValue': !exists(json, 'attribute-value') ? undefined : json['attribute-value'],
'attributeUnitsId': !exists(json, 'attribute-units-id') ? undefined : json['attribute-units-id'],
'attributeParameterTypeId': !exists(json, 'attribute-parameter-type-id') ? undefined : json['attribute-parameter-type-id'],
'attributeParameterId': !exists(json, 'attribute-parameter-id') ? undefined : json['attribute-parameter-id'],
'attributeDurationId': !exists(json, 'attribute-duration-id') ? undefined : json['attribute-duration-id'],
'attributeComment': !exists(json, 'attribute-comment') ? undefined : json['attribute-comment'],
'aliases': !exists(json, 'aliases') ? undefined : ((json['aliases'] as Array<any>).map(AliasFromJSON)),
'constituents': !exists(json, 'constituents') ? undefined : ((json['constituents'] as Array<any>).map(RATINGFromJSON)),
'constituentConnections': !exists(json, 'constituent-connections') ? undefined : json['constituent-connections'],
};
}
export function VirtualLocationLevelToJSON(value?: VirtualLocationLevel | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'office-id': value.officeId,
'location-level-id': value.locationLevelId,
'specified-level-id': value.specifiedLevelId,
'expiration-date': value.expirationDate === undefined ? undefined : (value.expirationDate.toISOString()),
'parameter-id': value.parameterId,
'parameter-type-id': value.parameterTypeId,
'interpolate-string': value.interpolateString,
'level-units-id': value.levelUnitsId,
'level-date': value.levelDate === undefined ? undefined : (value.levelDate.toISOString()),
'level-comment': value.levelComment,
'duration-id': value.durationId,
'attribute-value': value.attributeValue,
'attribute-units-id': value.attributeUnitsId,
'attribute-parameter-type-id': value.attributeParameterTypeId,
'attribute-parameter-id': value.attributeParameterId,
'attribute-duration-id': value.attributeDurationId,
'attribute-comment': value.attributeComment,
'aliases': value.aliases === undefined ? undefined : ((value.aliases as Array<any>).map(AliasToJSON)),
'constituents': value.constituents === undefined ? undefined : ((value.constituents as Array<any>).map(RATINGToJSON)),
'constituent-connections': value.constituentConnections,
};
}