UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

83 lines (82 loc) 3.48 kB
"use strict"; /* 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.instanceOfProductBundleExternal = instanceOfProductBundleExternal; exports.ProductBundleExternalFromJSON = ProductBundleExternalFromJSON; exports.ProductBundleExternalFromJSONTyped = ProductBundleExternalFromJSONTyped; exports.ProductBundleExternalToJSON = ProductBundleExternalToJSON; exports.ProductBundleExternalToJSONTyped = ProductBundleExternalToJSONTyped; const ProductBundleItemExternal_1 = require("./ProductBundleItemExternal"); const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the ProductBundleExternal interface. */ function instanceOfProductBundleExternal(value) { if (!('accountId' in value) || value['accountId'] === undefined) return false; if (!('amountSubtotalAtom' in value) || value['amountSubtotalAtom'] === undefined) return false; if (!('amountTotalAtom' in value) || value['amountTotalAtom'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } function ProductBundleExternalFromJSON(json) { return ProductBundleExternalFromJSONTyped(json, false); } function ProductBundleExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'accountId': json['account_id'], 'amountSubtotalAtom': json['amount_subtotal_atom'], 'amountTotalAtom': json['amount_total_atom'], 'bundleItems': json['bundle_items'] == null ? undefined : (json['bundle_items'].map(ProductBundleItemExternal_1.ProductBundleItemExternalFromJSON)), 'createdAt': (new Date(json['created_at'])), 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'name': json['name'], 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'updatedAt': (new Date(json['updated_at'])), }; } function ProductBundleExternalToJSON(json) { return ProductBundleExternalToJSONTyped(json, false); } function ProductBundleExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'account_id': value['accountId'], 'amount_subtotal_atom': value['amountSubtotalAtom'], 'amount_total_atom': value['amountTotalAtom'], 'bundle_items': value['bundleItems'] == null ? undefined : (value['bundleItems'].map(ProductBundleItemExternal_1.ProductBundleItemExternalToJSON)), 'created_at': ((value['createdAt']).toISOString()), 'id': value['id'], 'is_deleted': value['isDeleted'], 'name': value['name'], 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'updated_at': ((value['updatedAt']).toISOString()), }; }