/* 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';

/**
 * 
 * @export
 * @interface Entity
 */
export interface Entity {
    /**
     * 
     * @type {CwmsId}
     * @memberof Entity
     */
    id: CwmsId;
    /**
     * 
     * @type {string}
     * @memberof Entity
     */
    parentEntityId?: string;
    /**
     * 
     * @type {string}
     * @memberof Entity
     */
    categoryId?: string;
    /**
     * 
     * @type {string}
     * @memberof Entity
     */
    longName?: string;
}

export function EntityFromJSON(json: any): Entity {
    return EntityFromJSONTyped(json, false);
}

export function EntityFromJSONTyped(json: any, ignoreDiscriminator: boolean): Entity {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'id': CwmsIdFromJSON(json['id']),
        'parentEntityId': !exists(json, 'parent-entity-id') ? undefined : json['parent-entity-id'],
        'categoryId': !exists(json, 'category-id') ? undefined : json['category-id'],
        'longName': !exists(json, 'long-name') ? undefined : json['long-name'],
    };
}

export function EntityToJSON(value?: Entity | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'id': CwmsIdToJSON(value.id),
        'parent-entity-id': value.parentEntityId,
        'category-id': value.categoryId,
        'long-name': value.longName,
    };
}

