@getopenpay/client
Version:
OpenPay API TypeScript SDK
87 lines (86 loc) • 3.85 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.instanceOfBillingMeterExternal = instanceOfBillingMeterExternal;
exports.BillingMeterExternalFromJSON = BillingMeterExternalFromJSON;
exports.BillingMeterExternalFromJSONTyped = BillingMeterExternalFromJSONTyped;
exports.BillingMeterExternalToJSON = BillingMeterExternalToJSON;
exports.BillingMeterExternalToJSONTyped = BillingMeterExternalToJSONTyped;
const BillingMeterAggregationFormula_1 = require("./BillingMeterAggregationFormula");
const ObjectName_1 = require("./ObjectName");
/**
* Check if a given object implements the BillingMeterExternal interface.
*/
function instanceOfBillingMeterExternal(value) {
if (!('accountId' in value) || value['accountId'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
if (!('displayName' in value) || value['displayName'] === undefined)
return false;
if (!('eventName' in value) || value['eventName'] === undefined)
return false;
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('isActive' in value) || value['isActive'] === undefined)
return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
return false;
return true;
}
function BillingMeterExternalFromJSON(json) {
return BillingMeterExternalFromJSONTyped(json, false);
}
function BillingMeterExternalFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'accountId': json['account_id'],
'aggregationFormula': json['aggregation_formula'] == null ? undefined : (0, BillingMeterAggregationFormula_1.BillingMeterAggregationFormulaFromJSON)(json['aggregation_formula']),
'createdAt': (new Date(json['created_at'])),
'displayName': json['display_name'],
'eventName': json['event_name'],
'eventPayloadCustomerMappingKey': json['event_payload_customer_mapping_key'] == null ? undefined : json['event_payload_customer_mapping_key'],
'eventPayloadValueKey': json['event_payload_value_key'] == null ? undefined : json['event_payload_value_key'],
'id': json['id'],
'isActive': json['is_active'],
'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'],
'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']),
'updatedAt': (new Date(json['updated_at'])),
};
}
function BillingMeterExternalToJSON(json) {
return BillingMeterExternalToJSONTyped(json, false);
}
function BillingMeterExternalToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'account_id': value['accountId'],
'aggregation_formula': (0, BillingMeterAggregationFormula_1.BillingMeterAggregationFormulaToJSON)(value['aggregationFormula']),
'created_at': ((value['createdAt']).toISOString()),
'display_name': value['displayName'],
'event_name': value['eventName'],
'event_payload_customer_mapping_key': value['eventPayloadCustomerMappingKey'],
'event_payload_value_key': value['eventPayloadValueKey'],
'id': value['id'],
'is_active': value['isActive'],
'is_deleted': value['isDeleted'],
'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']),
'updated_at': ((value['updatedAt']).toISOString()),
};
}