/* 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 {
    BaseRatingMetadata,
    BaseRatingMetadataFromJSON,
    BaseRatingMetadataFromJSONTyped,
    BaseRatingMetadataToJSON,
} from './BaseRatingMetadata';
import {
    TableRatingAllOf,
    TableRatingAllOfFromJSON,
    TableRatingAllOfFromJSONTyped,
    TableRatingAllOfToJSON,
} from './TableRatingAllOf';
import {
    VerticalDatumInfo,
    VerticalDatumInfoFromJSON,
    VerticalDatumInfoFromJSONTyped,
    VerticalDatumInfoToJSON,
} from './VerticalDatumInfo';

/**
 * 
 * @export
 * @interface TableRating
 */
export interface TableRating {
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    officeId?: string;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    ratingSpecId?: string;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    unitsId?: string;
    /**
     * 
     * @type {boolean}
     * @memberof TableRating
     */
    active?: boolean;
    /**
     * 
     * @type {Date}
     * @memberof TableRating
     */
    effectiveDate?: Date;
    /**
     * 
     * @type {Date}
     * @memberof TableRating
     */
    createDate?: Date;
    /**
     * 
     * @type {Date}
     * @memberof TableRating
     */
    transitionDate?: Date;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    description?: string;
    /**
     * 
     * @type {VerticalDatumInfo}
     * @memberof TableRating
     */
    verticalDatumInfo?: VerticalDatumInfo;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    inRangeMethod?: string;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    outRangeLowMethod?: string;
    /**
     * 
     * @type {string}
     * @memberof TableRating
     */
    outRangeHighMethod?: string;
}

export function TableRatingFromJSON(json: any): TableRating {
    return TableRatingFromJSONTyped(json, false);
}

export function TableRatingFromJSONTyped(json: any, ignoreDiscriminator: boolean): TableRating {
    if ((json === undefined) || (json === null)) {
        return json;
    }
    return {
        
        'officeId': !exists(json, 'office-id') ? undefined : json['office-id'],
        'ratingSpecId': !exists(json, 'rating-spec-id') ? undefined : json['rating-spec-id'],
        'unitsId': !exists(json, 'units-id') ? undefined : json['units-id'],
        'active': !exists(json, 'active') ? undefined : json['active'],
        'effectiveDate': !exists(json, 'effective-date') ? undefined : (new Date(json['effective-date'])),
        'createDate': !exists(json, 'create-date') ? undefined : (new Date(json['create-date'])),
        'transitionDate': !exists(json, 'transition-date') ? undefined : (new Date(json['transition-date'])),
        'description': !exists(json, 'description') ? undefined : json['description'],
        'verticalDatumInfo': !exists(json, 'vertical-datum-info') ? undefined : VerticalDatumInfoFromJSON(json['vertical-datum-info']),
        'inRangeMethod': !exists(json, 'in-range-method') ? undefined : json['in-range-method'],
        'outRangeLowMethod': !exists(json, 'out-range-low-method') ? undefined : json['out-range-low-method'],
        'outRangeHighMethod': !exists(json, 'out-range-high-method') ? undefined : json['out-range-high-method'],
    };
}

export function TableRatingToJSON(value?: TableRating | null): any {
    if (value === undefined) {
        return undefined;
    }
    if (value === null) {
        return null;
    }
    return {
        
        'office-id': value.officeId,
        'rating-spec-id': value.ratingSpecId,
        'units-id': value.unitsId,
        'active': value.active,
        'effective-date': value.effectiveDate === undefined ? undefined : (value.effectiveDate.toISOString()),
        'create-date': value.createDate === undefined ? undefined : (value.createDate.toISOString()),
        'transition-date': value.transitionDate === undefined ? undefined : (value.transitionDate.toISOString()),
        'description': value.description,
        'vertical-datum-info': VerticalDatumInfoToJSON(value.verticalDatumInfo),
        'in-range-method': value.inRangeMethod,
        'out-range-low-method': value.outRangeLowMethod,
        'out-range-high-method': value.outRangeHighMethod,
    };
}

