cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
194 lines (185 loc) • 5.46 kB
text/typescript
/* 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';
import {
LookupType,
LookupTypeFromJSON,
LookupTypeFromJSONTyped,
LookupTypeToJSON,
} from './LookupType';
import {
WaterSupplyPump,
WaterSupplyPumpFromJSON,
WaterSupplyPumpFromJSONTyped,
WaterSupplyPumpToJSON,
} from './WaterSupplyPump';
import {
WaterUser,
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;
}
export function WaterUserContractFromJSON(json: any): WaterUserContract {
return WaterUserContractFromJSONTyped(json, false);
}
export function WaterUserContractFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaterUserContract {
if ((json === undefined) || (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': !exists(json, 'pump-out-location') ? undefined : WaterSupplyPumpFromJSON(json['pump-out-location']),
'pumpOutBelowLocation': !exists(json, 'pump-out-below-location') ? undefined : WaterSupplyPumpFromJSON(json['pump-out-below-location']),
'pumpInLocation': !exists(json, 'pump-in-location') ? undefined : WaterSupplyPumpFromJSON(json['pump-in-location']),
};
}
export function WaterUserContractToJSON(value?: WaterUserContract | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
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),
};
}