cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
258 lines (248 loc) • 6.74 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';
/**
*
* @export
* @interface Location
*/
export interface Location {
/**
* Owning office of object.
* @type {string}
* @memberof Location
*/
officeId: string;
/**
*
* @type {string}
* @memberof Location
*/
name: string;
/**
*
* @type {number}
* @memberof Location
*/
latitude?: number;
/**
*
* @type {number}
* @memberof Location
*/
longitude?: number;
/**
*
* @type {boolean}
* @memberof Location
*/
active?: boolean;
/**
*
* @type {string}
* @memberof Location
*/
publicName?: string;
/**
*
* @type {string}
* @memberof Location
*/
longName?: string;
/**
*
* @type {string}
* @memberof Location
*/
description?: string;
/**
*
* @type {string}
* @memberof Location
*/
timezoneName?: string;
/**
*
* @type {string}
* @memberof Location
*/
locationType?: string;
/**
*
* @type {string}
* @memberof Location
*/
locationKind?: string;
/**
*
* @type {string}
* @memberof Location
*/
nation?: LocationNationEnum;
/**
*
* @type {string}
* @memberof Location
*/
stateInitial?: string;
/**
*
* @type {string}
* @memberof Location
*/
countyName?: string;
/**
*
* @type {string}
* @memberof Location
*/
nearestCity?: string;
/**
*
* @type {string}
* @memberof Location
*/
horizontalDatum?: string;
/**
*
* @type {number}
* @memberof Location
*/
publishedLongitude?: number;
/**
*
* @type {number}
* @memberof Location
*/
publishedLatitude?: number;
/**
*
* @type {string}
* @memberof Location
*/
verticalDatum?: string;
/**
*
* @type {number}
* @memberof Location
*/
elevation?: number;
/**
*
* @type {string}
* @memberof Location
*/
mapLabel?: string;
/**
*
* @type {string}
* @memberof Location
*/
boundingOfficeId?: string;
/**
*
* @type {string}
* @memberof Location
*/
elevationUnits?: string;
/**
*
* @type {Array<Alias>}
* @memberof Location
*/
aliases?: Array<Alias>;
}
/**
* @export
* @enum {string}
*/
export enum LocationNationEnum {
Us = 'US',
Canada = 'CANADA',
Mexico = 'MEXICO'
}
export function LocationFromJSON(json: any): Location {
return LocationFromJSONTyped(json, false);
}
export function LocationFromJSONTyped(json: any, ignoreDiscriminator: boolean): Location {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'officeId': json['office-id'],
'name': json['name'],
'latitude': !exists(json, 'latitude') ? undefined : json['latitude'],
'longitude': !exists(json, 'longitude') ? undefined : json['longitude'],
'active': !exists(json, 'active') ? undefined : json['active'],
'publicName': !exists(json, 'public-name') ? undefined : json['public-name'],
'longName': !exists(json, 'long-name') ? undefined : json['long-name'],
'description': !exists(json, 'description') ? undefined : json['description'],
'timezoneName': !exists(json, 'timezone-name') ? undefined : json['timezone-name'],
'locationType': !exists(json, 'location-type') ? undefined : json['location-type'],
'locationKind': !exists(json, 'location-kind') ? undefined : json['location-kind'],
'nation': !exists(json, 'nation') ? undefined : json['nation'],
'stateInitial': !exists(json, 'state-initial') ? undefined : json['state-initial'],
'countyName': !exists(json, 'county-name') ? undefined : json['county-name'],
'nearestCity': !exists(json, 'nearest-city') ? undefined : json['nearest-city'],
'horizontalDatum': !exists(json, 'horizontal-datum') ? undefined : json['horizontal-datum'],
'publishedLongitude': !exists(json, 'published-longitude') ? undefined : json['published-longitude'],
'publishedLatitude': !exists(json, 'published-latitude') ? undefined : json['published-latitude'],
'verticalDatum': !exists(json, 'vertical-datum') ? undefined : json['vertical-datum'],
'elevation': !exists(json, 'elevation') ? undefined : json['elevation'],
'mapLabel': !exists(json, 'map-label') ? undefined : json['map-label'],
'boundingOfficeId': !exists(json, 'bounding-office-id') ? undefined : json['bounding-office-id'],
'elevationUnits': !exists(json, 'elevation-units') ? undefined : json['elevation-units'],
'aliases': !exists(json, 'aliases') ? undefined : ((json['aliases'] as Array<any>).map(AliasFromJSON)),
};
}
export function LocationToJSON(value?: Location | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'office-id': value.officeId,
'name': value.name,
'latitude': value.latitude,
'longitude': value.longitude,
'active': value.active,
'public-name': value.publicName,
'long-name': value.longName,
'description': value.description,
'timezone-name': value.timezoneName,
'location-type': value.locationType,
'location-kind': value.locationKind,
'nation': value.nation,
'state-initial': value.stateInitial,
'county-name': value.countyName,
'nearest-city': value.nearestCity,
'horizontal-datum': value.horizontalDatum,
'published-longitude': value.publishedLongitude,
'published-latitude': value.publishedLatitude,
'vertical-datum': value.verticalDatum,
'elevation': value.elevation,
'map-label': value.mapLabel,
'bounding-office-id': value.boundingOfficeId,
'elevation-units': value.elevationUnits,
'aliases': value.aliases === undefined ? undefined : ((value.aliases as Array<any>).map(AliasToJSON)),
};
}