UNPKG

cwmsjs

Version:

CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps

66 lines (65 loc) 2.87 kB
/* tslint:disable */ /* eslint-disable */ /** * CWMS Data API * CWMS REST API for Data Retrieval * * The version of the OpenAPI document: 2.3.2-2025.03.19 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import { CwmsIdFromJSON, CwmsIdToJSON, } from './CwmsId'; import { LocationFromJSON, LocationToJSON, } from './Location'; import { LookupTypeFromJSON, LookupTypeToJSON, } from './LookupType'; /** * Check if a given object implements the Embankment interface. */ export function instanceOfEmbankment(value) { if (!('projectId' in value)) return false; if (!('location' in value)) return false; return true; } export function EmbankmentFromJSON(json) { return EmbankmentFromJSONTyped(json, false); } export function EmbankmentFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'projectId': CwmsIdFromJSON(json['project-id']), 'location': LocationFromJSON(json['location']), 'structureType': json['structure-type'] == null ? undefined : LookupTypeFromJSON(json['structure-type']), 'upstreamSideSlope': json['upstream-side-slope'] == null ? undefined : json['upstream-side-slope'], 'downstreamSideSlope': json['downstream-side-slope'] == null ? undefined : json['downstream-side-slope'], 'structureLength': json['structure-length'] == null ? undefined : json['structure-length'], 'maxHeight': json['max-height'] == null ? undefined : json['max-height'], 'topWidth': json['top-width'] == null ? undefined : json['top-width'], 'lengthUnits': json['length-units'] == null ? undefined : json['length-units'], 'downstreamProtectionType': json['downstream-protection-type'] == null ? undefined : LookupTypeFromJSON(json['downstream-protection-type']), 'upstreamProtectionType': json['upstream-protection-type'] == null ? undefined : LookupTypeFromJSON(json['upstream-protection-type']), }; } export function EmbankmentToJSON(value) { if (value == null) { return value; } 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']), }; }