UNPKG

cwmsjs

Version:

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

58 lines (57 loc) 2.59 kB
"use strict"; /* 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. */ Object.defineProperty(exports, "__esModule", { value: true }); const runtime_1 = require("../runtime"); const AssignedLocation_1 = require("./AssignedLocation"); const LocationCategory_1 = require("./LocationCategory"); function LocationGroupFromJSON(json) { return LocationGroupFromJSONTyped(json, false); } exports.LocationGroupFromJSON = LocationGroupFromJSON; function LocationGroupFromJSONTyped(json, ignoreDiscriminator) { if ((json === undefined) || (json === null)) { return json; } return { 'officeId': json['office-id'], 'id': !runtime_1.exists(json, 'id') ? undefined : json['id'], 'locationCategory': !runtime_1.exists(json, 'location-category') ? undefined : LocationCategory_1.LocationCategoryFromJSON(json['location-category']), 'description': !runtime_1.exists(json, 'description') ? undefined : json['description'], 'sharedLocAliasId': !runtime_1.exists(json, 'shared-loc-alias-id') ? undefined : json['shared-loc-alias-id'], 'sharedRefLocationId': !runtime_1.exists(json, 'shared-ref-location-id') ? undefined : json['shared-ref-location-id'], 'locGroupAttribute': !runtime_1.exists(json, 'loc-group-attribute') ? undefined : json['loc-group-attribute'], 'assignedLocations': !runtime_1.exists(json, 'assigned-locations') ? undefined : (json['assigned-locations'].map(AssignedLocation_1.AssignedLocationFromJSON)), }; } exports.LocationGroupFromJSONTyped = LocationGroupFromJSONTyped; function LocationGroupToJSON(value) { if (value === undefined) { return undefined; } if (value === null) { return null; } return { 'office-id': value.officeId, 'id': value.id, 'location-category': LocationCategory_1.LocationCategoryToJSON(value.locationCategory), 'description': value.description, 'shared-loc-alias-id': value.sharedLocAliasId, 'shared-ref-location-id': value.sharedRefLocationId, 'loc-group-attribute': value.locGroupAttribute, 'assigned-locations': value.assignedLocations === undefined ? undefined : (value.assignedLocations.map(AssignedLocation_1.AssignedLocationToJSON)), }; } exports.LocationGroupToJSON = LocationGroupToJSON;