@getopenpay/client
Version:
OpenPay API TypeScript SDK
67 lines (66 loc) • 2.42 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* OpenPay API
* super charge your subscription management.
*
* The version of the OpenAPI document: 1.2.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfBillingMeterSummary = instanceOfBillingMeterSummary;
exports.BillingMeterSummaryFromJSON = BillingMeterSummaryFromJSON;
exports.BillingMeterSummaryFromJSONTyped = BillingMeterSummaryFromJSONTyped;
exports.BillingMeterSummaryToJSON = BillingMeterSummaryToJSON;
exports.BillingMeterSummaryToJSONTyped = BillingMeterSummaryToJSONTyped;
/**
* Check if a given object implements the BillingMeterSummary interface.
*/
function instanceOfBillingMeterSummary(value) {
if (!('aggregatedValue' in value) || value['aggregatedValue'] === undefined)
return false;
if (!('documentCount' in value) || value['documentCount'] === undefined)
return false;
if (!('endDatetime' in value) || value['endDatetime'] === undefined)
return false;
if (!('meterId' in value) || value['meterId'] === undefined)
return false;
if (!('startDatetime' in value) || value['startDatetime'] === undefined)
return false;
return true;
}
function BillingMeterSummaryFromJSON(json) {
return BillingMeterSummaryFromJSONTyped(json, false);
}
function BillingMeterSummaryFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'aggregatedValue': json['aggregated_value'],
'documentCount': json['document_count'],
'endDatetime': (new Date(json['end_datetime'])),
'meterId': json['meter_id'],
'startDatetime': (new Date(json['start_datetime'])),
};
}
function BillingMeterSummaryToJSON(json) {
return BillingMeterSummaryToJSONTyped(json, false);
}
function BillingMeterSummaryToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'aggregated_value': value['aggregatedValue'],
'document_count': value['documentCount'],
'end_datetime': ((value['endDatetime']).toISOString()),
'meter_id': value['meterId'],
'start_datetime': ((value['startDatetime']).toISOString()),
};
}