/* 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 type { LookupType } from './LookupType';
import {
    LookupTypeFromJSON,
    LookupTypeFromJSONTyped,
    LookupTypeToJSON,
} from './LookupType';
import type { WaterSupplyPump } from './WaterSupplyPump';
import {
    WaterSupplyPumpFromJSON,
    WaterSupplyPumpFromJSONTyped,
    WaterSupplyPumpToJSON,
} from './WaterSupplyPump';
import type { WaterUser } from './WaterUser';
import {
    WaterUserFromJSON,
    WaterUserFromJSONTyped,
    WaterUserToJSON,
} from './WaterUser';

/**
 * 
 * @export
 * @interface WaterUserContract
 */
export interface WaterUserContract {
    /**
     * Owning office of object.
     * @type {string}
     * @memberof WaterUserContract
     */
    officeId: string;
    /**
     * 
     * @type {WaterUser}
     * @memberof WaterUserContract
     */
    waterUser: WaterUser;
    /**
     * 
     * @type {CwmsId}
     * @memberof WaterUserContract
     */
    contractId: CwmsId;
    /**
     * 
     * @type {LookupType}
     * @memberof WaterUserContract
     */
    contractType: LookupType;
    /**
     * 
     * @type {Date}
     * @memberof WaterUserContract
     */
    contractEffectiveDate: Date;
    /**
     * 
     * @type {Date}
     * @memberof WaterUserContract
     */
    contractExpirationDate: Date;
    /**
     * 
     * @type {number}
     * @memberof WaterUserContract
     */
    contractedStorage: number;
    /**
     * 
     * @type {number}
     * @memberof WaterUserContract
     */
    initialUseAllocation: number;
    /**
     * 
     * @type {number}
     * @memberof WaterUserContract
     */
    futureUseAllocation: number;
    /**
     * 
     * @type {string}
     * @memberof WaterUserContract
     */
    storageUnitsId: string;
    /**
     * 
     * @type {number}
     * @memberof WaterUserContract
     */
    futureUsePercentActivated: number;
    /**
     * 
     * @type {number}
     * @memberof WaterUserContract
     */
    totalAllocPercentActivated: number;
    /**
     * 
     * @type {WaterSupplyPump}
     * @memberof WaterUserContract
     */
    pumpOutLocation?: WaterSupplyPump;
    /**
     * 
     * @type {WaterSupplyPump}
     * @memberof WaterUserContract
     */
    pumpOutBelowLocation?: WaterSupplyPump;
    /**
     * 
     * @type {WaterSupplyPump}
     * @memberof WaterUserContract
     */
    pumpInLocation?: WaterSupplyPump;
}

/**
 * Check if a given object implements the WaterUserContract interface.
 */
export function instanceOfWaterUserContract(value: object): boolean {
    if (!('officeId' in value)) return false;
    if (!('waterUser' in value)) return false;
    if (!('contractId' in value)) return false;
    if (!('contractType' in value)) return false;
    if (!('contractEffectiveDate' in value)) return false;
    if (!('contractExpirationDate' in value)) return false;
    if (!('contractedStorage' in value)) return false;
    if (!('initialUseAllocation' in value)) return false;
    if (!('futureUseAllocation' in value)) return false;
    if (!('storageUnitsId' in value)) return false;
    if (!('futureUsePercentActivated' in value)) return false;
    if (!('totalAllocPercentActivated' in value)) return false;
    return true;
}

export function WaterUserContractFromJSON(json: any): WaterUserContract {
    return WaterUserContractFromJSONTyped(json, false);
}

export function WaterUserContractFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaterUserContract {
    if (json == null) {
        return json;
    }
    return {
        
        'officeId': json['office-id'],
        'waterUser': WaterUserFromJSON(json['water-user']),
        'contractId': CwmsIdFromJSON(json['contract-id']),
        'contractType': LookupTypeFromJSON(json['contract-type']),
        'contractEffectiveDate': (new Date(json['contract-effective-date'])),
        'contractExpirationDate': (new Date(json['contract-expiration-date'])),
        'contractedStorage': json['contracted-storage'],
        'initialUseAllocation': json['initial-use-allocation'],
        'futureUseAllocation': json['future-use-allocation'],
        'storageUnitsId': json['storage-units-id'],
        'futureUsePercentActivated': json['future-use-percent-activated'],
        'totalAllocPercentActivated': json['total-alloc-percent-activated'],
        'pumpOutLocation': json['pump-out-location'] == null ? undefined : WaterSupplyPumpFromJSON(json['pump-out-location']),
        'pumpOutBelowLocation': json['pump-out-below-location'] == null ? undefined : WaterSupplyPumpFromJSON(json['pump-out-below-location']),
        'pumpInLocation': json['pump-in-location'] == null ? undefined : WaterSupplyPumpFromJSON(json['pump-in-location']),
    };
}

export function WaterUserContractToJSON(value?: WaterUserContract | null): any {
    if (value == null) {
        return value;
    }
    return {
        
        'office-id': value['officeId'],
        'water-user': WaterUserToJSON(value['waterUser']),
        'contract-id': CwmsIdToJSON(value['contractId']),
        'contract-type': LookupTypeToJSON(value['contractType']),
        'contract-effective-date': ((value['contractEffectiveDate']).toISOString()),
        'contract-expiration-date': ((value['contractExpirationDate']).toISOString()),
        'contracted-storage': value['contractedStorage'],
        'initial-use-allocation': value['initialUseAllocation'],
        'future-use-allocation': value['futureUseAllocation'],
        'storage-units-id': value['storageUnitsId'],
        'future-use-percent-activated': value['futureUsePercentActivated'],
        'total-alloc-percent-activated': value['totalAllocPercentActivated'],
        'pump-out-location': WaterSupplyPumpToJSON(value['pumpOutLocation']),
        'pump-out-below-location': WaterSupplyPumpToJSON(value['pumpOutBelowLocation']),
        'pump-in-location': WaterSupplyPumpToJSON(value['pumpInLocation']),
    };
}

