cwmsjs
Version:
CWMS Data API Library for JavaScript/TypeScript created with OpenAPI generator for use with browser webapps
100 lines (91 loc) • 2.5 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 {
PumpLocation,
PumpLocationFromJSON,
PumpLocationFromJSONTyped,
PumpLocationToJSON,
} from './PumpLocation';
import {
PumpTransfer,
PumpTransferFromJSON,
PumpTransferFromJSONTyped,
PumpTransferToJSON,
} from './PumpTransfer';
import {
WaterUser,
WaterUserFromJSON,
WaterUserFromJSONTyped,
WaterUserToJSON,
} from './WaterUser';
/**
*
* @export
* @interface WaterSupplyAccounting
*/
export interface WaterSupplyAccounting {
/**
*
* @type {string}
* @memberof WaterSupplyAccounting
*/
contractName: string;
/**
*
* @type {WaterUser}
* @memberof WaterSupplyAccounting
*/
waterUser: WaterUser;
/**
*
* @type {PumpLocation}
* @memberof WaterSupplyAccounting
*/
pumpLocations: PumpLocation;
/**
*
* @type {{ [key: string]: Array<PumpTransfer>; }}
* @memberof WaterSupplyAccounting
*/
pumpAccounting?: { [key: string]: Array<PumpTransfer>; };
}
export function WaterSupplyAccountingFromJSON(json: any): WaterSupplyAccounting {
return WaterSupplyAccountingFromJSONTyped(json, false);
}
export function WaterSupplyAccountingFromJSONTyped(json: any, ignoreDiscriminator: boolean): WaterSupplyAccounting {
if ((json === undefined) || (json === null)) {
return json;
}
return {
'contractName': json['contract-name'],
'waterUser': WaterUserFromJSON(json['water-user']),
'pumpLocations': PumpLocationFromJSON(json['pump-locations']),
'pumpAccounting': !exists(json, 'pump-accounting') ? undefined : json['pump-accounting'],
};
}
export function WaterSupplyAccountingToJSON(value?: WaterSupplyAccounting | null): any {
if (value === undefined) {
return undefined;
}
if (value === null) {
return null;
}
return {
'contract-name': value.contractName,
'water-user': WaterUserToJSON(value.waterUser),
'pump-locations': PumpLocationToJSON(value.pumpLocations),
'pump-accounting': value.pumpAccounting,
};
}