@getopenpay/client
Version:
OpenPay API TypeScript SDK
109 lines (108 loc) • 4.8 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.instanceOfProductBundleItemExternal = instanceOfProductBundleItemExternal;
exports.ProductBundleItemExternalFromJSON = ProductBundleItemExternalFromJSON;
exports.ProductBundleItemExternalFromJSONTyped = ProductBundleItemExternalFromJSONTyped;
exports.ProductBundleItemExternalToJSON = ProductBundleItemExternalToJSON;
exports.ProductBundleItemExternalToJSONTyped = ProductBundleItemExternalToJSONTyped;
const CalendarIntervalEnum_1 = require("./CalendarIntervalEnum");
const ObjectName_1 = require("./ObjectName");
/**
* Check if a given object implements the ProductBundleItemExternal interface.
*/
function instanceOfProductBundleItemExternal(value) {
if (!('amountSubtotalAtom' in value) || value['amountSubtotalAtom'] === undefined)
return false;
if (!('amountTotalAtom' in value) || value['amountTotalAtom'] === undefined)
return false;
if (!('billingInterval' in value) || value['billingInterval'] === undefined)
return false;
if (!('billingIntervalCount' in value) || value['billingIntervalCount'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
if (!('currency' in value) || value['currency'] === undefined)
return false;
if (!('customFields' in value) || value['customFields'] === undefined)
return false;
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('priceId' in value) || value['priceId'] === undefined)
return false;
if (!('productBundleId' in value) || value['productBundleId'] === undefined)
return false;
if (!('productId' in value) || value['productId'] === undefined)
return false;
if (!('quantity' in value) || value['quantity'] === undefined)
return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
return false;
return true;
}
function ProductBundleItemExternalFromJSON(json) {
return ProductBundleItemExternalFromJSONTyped(json, false);
}
function ProductBundleItemExternalFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'amountSubtotalAtom': json['amount_subtotal_atom'],
'amountTotalAtom': json['amount_total_atom'],
'billingInterval': (0, CalendarIntervalEnum_1.CalendarIntervalEnumFromJSON)(json['billing_interval']),
'billingIntervalCount': json['billing_interval_count'],
'createdAt': (new Date(json['created_at'])),
'currency': json['currency'],
'customFields': json['custom_fields'],
'description': json['description'] == null ? undefined : json['description'],
'id': json['id'],
'isDefault': json['is_default'] == null ? undefined : json['is_default'],
'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'],
'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']),
'priceId': json['price_id'],
'productBundleId': json['product_bundle_id'],
'productId': json['product_id'],
'quantity': json['quantity'],
'updatedAt': (new Date(json['updated_at'])),
};
}
function ProductBundleItemExternalToJSON(json) {
return ProductBundleItemExternalToJSONTyped(json, false);
}
function ProductBundleItemExternalToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'amount_subtotal_atom': value['amountSubtotalAtom'],
'amount_total_atom': value['amountTotalAtom'],
'billing_interval': (0, CalendarIntervalEnum_1.CalendarIntervalEnumToJSON)(value['billingInterval']),
'billing_interval_count': value['billingIntervalCount'],
'created_at': ((value['createdAt']).toISOString()),
'currency': value['currency'],
'custom_fields': value['customFields'],
'description': value['description'],
'id': value['id'],
'is_default': value['isDefault'],
'is_deleted': value['isDeleted'],
'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']),
'price_id': value['priceId'],
'product_bundle_id': value['productBundleId'],
'product_id': value['productId'],
'quantity': value['quantity'],
'updated_at': ((value['updatedAt']).toISOString()),
};
}