UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

118 lines (117 loc) 5.43 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.instanceOfCheckoutSessionLineItemExternal = instanceOfCheckoutSessionLineItemExternal; exports.CheckoutSessionLineItemExternalFromJSON = CheckoutSessionLineItemExternalFromJSON; exports.CheckoutSessionLineItemExternalFromJSONTyped = CheckoutSessionLineItemExternalFromJSONTyped; exports.CheckoutSessionLineItemExternalToJSON = CheckoutSessionLineItemExternalToJSON; exports.CheckoutSessionLineItemExternalToJSONTyped = CheckoutSessionLineItemExternalToJSONTyped; const CalendarIntervalEnum_1 = require("./CalendarIntervalEnum"); const CurrencyEnum_1 = require("./CurrencyEnum"); const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the CheckoutSessionLineItemExternal interface. */ function instanceOfCheckoutSessionLineItemExternal(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 (!('checkoutSessionId' in value) || value['checkoutSessionId'] === 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 (!('description' in value) || value['description'] === undefined) return false; if (!('descriptionDetailed' in value) || value['descriptionDetailed'] === 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 CheckoutSessionLineItemExternalFromJSON(json) { return CheckoutSessionLineItemExternalFromJSONTyped(json, false); } function CheckoutSessionLineItemExternalFromJSONTyped(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'], 'checkoutSessionId': json['checkout_session_id'], 'createdAt': (new Date(json['created_at'])), 'currency': (0, CurrencyEnum_1.CurrencyEnumFromJSON)(json['currency']), 'customFields': json['custom_fields'], 'description': json['description'], 'descriptionDetailed': json['description_detailed'], 'id': json['id'], '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 CheckoutSessionLineItemExternalToJSON(json) { return CheckoutSessionLineItemExternalToJSONTyped(json, false); } function CheckoutSessionLineItemExternalToJSONTyped(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'], 'checkout_session_id': value['checkoutSessionId'], 'created_at': ((value['createdAt']).toISOString()), 'currency': (0, CurrencyEnum_1.CurrencyEnumToJSON)(value['currency']), 'custom_fields': value['customFields'], 'description': value['description'], 'description_detailed': value['descriptionDetailed'], 'id': value['id'], '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()), }; }