/* 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 { mapValues } from '../runtime';
import type { CwmsId } from './CwmsId';
import {
    CwmsIdFromJSON,
    CwmsIdFromJSONTyped,
    CwmsIdToJSON,
} from './CwmsId';

import {
} from './index';

/**
 * 
 * @export
 * @interface GateSetting
 */
export interface GateSetting {
    /**
     * 
     * @type {CwmsId}
     * @memberof GateSetting
     */
    locationId: CwmsId;
    /**
     * 
     * @type {number}
     * @memberof GateSetting
     */
    opening: number;
    /**
     * 
     * @type {string}
     * @memberof GateSetting
     */
    openingParameter: string;
    /**
     * 
     * @type {string}
     * @memberof GateSetting
     */
    openingUnits: string;
    /**
     * 
     * @type {number}
     * @memberof GateSetting
     */
    invertElevation: number;
    /**
     * 
     * @type {string}
     * @memberof GateSetting
     */
    type?: string;
}

/**
 * Check if a given object implements the GateSetting interface.
 */
export function instanceOfGateSetting(value: object): boolean {
    if (!('locationId' in value)) return false;
    if (!('opening' in value)) return false;
    if (!('openingParameter' in value)) return false;
    if (!('openingUnits' in value)) return false;
    if (!('invertElevation' in value)) return false;
    return true;
}

export function GateSettingFromJSON(json: any): GateSetting {
    return GateSettingFromJSONTyped(json, false);
}

export function GateSettingFromJSONTyped(json: any, ignoreDiscriminator: boolean): GateSetting {
    if (json == null) {
        return json;
    }
    if (!ignoreDiscriminator) {
    }
    return {
        
        'locationId': CwmsIdFromJSON(json['location-id']),
        'opening': json['opening'],
        'openingParameter': json['opening-parameter'],
        'openingUnits': json['opening-units'],
        'invertElevation': json['invert-elevation'],
        'type': json['type'] == null ? undefined : json['type'],
    };
}

export function GateSettingToJSON(value?: GateSetting | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'location-id': CwmsIdToJSON(value['locationId']),
        'opening': value['opening'],
        'opening-parameter': value['openingParameter'],
        'opening-units': value['openingUnits'],
        'invert-elevation': value['invertElevation'],
        'type': value['type'],
    };
}

