UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

74 lines (73 loc) 2.79 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.instanceOfPriceTierExternal = instanceOfPriceTierExternal; exports.PriceTierExternalFromJSON = PriceTierExternalFromJSON; exports.PriceTierExternalFromJSONTyped = PriceTierExternalFromJSONTyped; exports.PriceTierExternalToJSON = PriceTierExternalToJSON; exports.PriceTierExternalToJSONTyped = PriceTierExternalToJSONTyped; const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the PriceTierExternal interface. */ function instanceOfPriceTierExternal(value) { if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('flatAmountAtom' in value) || value['flatAmountAtom'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('unitAmountAtom' in value) || value['unitAmountAtom'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } function PriceTierExternalFromJSON(json) { return PriceTierExternalFromJSONTyped(json, false); } function PriceTierExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'createdAt': (new Date(json['created_at'])), 'flatAmountAtom': json['flat_amount_atom'], 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'unitAmountAtom': json['unit_amount_atom'], 'unitsUpto': json['units_upto'] == null ? undefined : json['units_upto'], 'updatedAt': (new Date(json['updated_at'])), }; } function PriceTierExternalToJSON(json) { return PriceTierExternalToJSONTyped(json, false); } function PriceTierExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'created_at': ((value['createdAt']).toISOString()), 'flat_amount_atom': value['flatAmountAtom'], 'id': value['id'], 'is_deleted': value['isDeleted'], 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'unit_amount_atom': value['unitAmountAtom'], 'units_upto': value['unitsUpto'], 'updated_at': ((value['updatedAt']).toISOString()), }; }