cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
156 lines (147 loc) • 4.22 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 {
Location,
LocationFromJSON,
LocationFromJSONTyped,
LocationToJSON,
} from './Location';
import {
LookupType,
LookupTypeFromJSON,
LookupTypeFromJSONTyped,
LookupTypeToJSON,
} from './LookupType';
/**
*
* @export
* @interface Embankment
*/
export interface Embankment {
/**
*
* @type {CwmsId}
* @memberof Embankment
*/
projectId: CwmsId;
/**
*
* @type {Location}
* @memberof Embankment
*/
location: Location;
/**
*
* @type {LookupType}
* @memberof Embankment
*/
structureType?: LookupType;
/**
*
* @type {number}
* @memberof Embankment
*/
upstreamSideSlope?: number;
/**
*
* @type {number}
* @memberof Embankment
*/
downstreamSideSlope?: number;
/**
*
* @type {number}
* @memberof Embankment
*/
structureLength?: number;
/**
*
* @type {number}
* @memberof Embankment
*/
maxHeight?: number;
/**
*
* @type {number}
* @memberof Embankment
*/
topWidth?: number;
/**
*
* @type {string}
* @memberof Embankment
*/
lengthUnits?: string;
/**
*
* @type {LookupType}
* @memberof Embankment
*/
downstreamProtectionType?: LookupType;
/**
*
* @type {LookupType}
* @memberof Embankment
*/
upstreamProtectionType?: LookupType;
}
export function EmbankmentFromJSON(json: any): Embankment {
return EmbankmentFromJSONTyped(json, false);
}
export function EmbankmentFromJSONTyped(json: any, ignoreDiscriminator: boolean): Embankment {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'projectId': CwmsIdFromJSON(json['project-id']),
'location': LocationFromJSON(json['location']),
'structureType': !exists(json, 'structure-type') ? undefined : LookupTypeFromJSON(json['structure-type']),
'upstreamSideSlope': !exists(json, 'upstream-side-slope') ? undefined : json['upstream-side-slope'],
'downstreamSideSlope': !exists(json, 'downstream-side-slope') ? undefined : json['downstream-side-slope'],
'structureLength': !exists(json, 'structure-length') ? undefined : json['structure-length'],
'maxHeight': !exists(json, 'max-height') ? undefined : json['max-height'],
'topWidth': !exists(json, 'top-width') ? undefined : json['top-width'],
'lengthUnits': !exists(json, 'length-units') ? undefined : json['length-units'],
'downstreamProtectionType': !exists(json, 'downstream-protection-type') ? undefined : LookupTypeFromJSON(json['downstream-protection-type']),
'upstreamProtectionType': !exists(json, 'upstream-protection-type') ? undefined : LookupTypeFromJSON(json['upstream-protection-type']),
};
}
export function EmbankmentToJSON(value?: Embankment | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'project-id': CwmsIdToJSON(value.projectId),
'location': LocationToJSON(value.location),
'structure-type': LookupTypeToJSON(value.structureType),
'upstream-side-slope': value.upstreamSideSlope,
'downstream-side-slope': value.downstreamSideSlope,
'structure-length': value.structureLength,
'max-height': value.maxHeight,
'top-width': value.topWidth,
'length-units': value.lengthUnits,
'downstream-protection-type': LookupTypeToJSON(value.downstreamProtectionType),
'upstream-protection-type': LookupTypeToJSON(value.upstreamProtectionType),
};
}