UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

131 lines (130 loc) 5.91 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.instanceOfPaymentLinkExternal = instanceOfPaymentLinkExternal; exports.PaymentLinkExternalFromJSON = PaymentLinkExternalFromJSON; exports.PaymentLinkExternalFromJSONTyped = PaymentLinkExternalFromJSONTyped; exports.PaymentLinkExternalToJSON = PaymentLinkExternalToJSON; exports.PaymentLinkExternalToJSONTyped = PaymentLinkExternalToJSONTyped; const CheckoutPreferencesOutput_1 = require("./CheckoutPreferencesOutput"); const PaymentLinkLineItemExternal_1 = require("./PaymentLinkLineItemExternal"); const CheckoutMode_1 = require("./CheckoutMode"); const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the PaymentLinkExternal interface. */ function instanceOfPaymentLinkExternal(value) { if (!('accountId' in value) || value['accountId'] === undefined) return false; if (!('accountName' in value) || value['accountName'] === undefined) return false; if (!('active' in value) || value['active'] === undefined) return false; if (!('checkoutPreferences' in value) || value['checkoutPreferences'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('currency' in value) || value['currency'] === undefined) return false; if (!('customerEmail' in value) || value['customerEmail'] === undefined) return false; if (!('customerId' in value) || value['customerId'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('lineItems' in value) || value['lineItems'] === undefined) return false; if (!('mode' in value) || value['mode'] === undefined) return false; if (!('secureToken' in value) || value['secureToken'] === undefined) return false; if (!('successUrl' in value) || value['successUrl'] === undefined) return false; if (!('trialEnd' in value) || value['trialEnd'] === undefined) return false; if (!('trialFromPrice' in value) || value['trialFromPrice'] === undefined) return false; if (!('trialPeriodDays' in value) || value['trialPeriodDays'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; if (!('url' in value) || value['url'] === undefined) return false; return true; } function PaymentLinkExternalFromJSON(json) { return PaymentLinkExternalFromJSONTyped(json, false); } function PaymentLinkExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'accountId': json['account_id'], 'accountName': json['account_name'], 'active': json['active'], 'checkoutPreferences': (0, CheckoutPreferencesOutput_1.CheckoutPreferencesOutputFromJSON)(json['checkout_preferences']), 'couponId': json['coupon_id'] == null ? undefined : json['coupon_id'], 'createdAt': (new Date(json['created_at'])), 'currency': json['currency'], 'customFields': json['custom_fields'] == null ? undefined : json['custom_fields'], 'customerEmail': json['customer_email'], 'customerId': json['customer_id'], 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'lineItems': (json['line_items'].map(PaymentLinkLineItemExternal_1.PaymentLinkLineItemExternalFromJSON)), 'mode': (0, CheckoutMode_1.CheckoutModeFromJSON)(json['mode']), 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'secureToken': json['secure_token'], 'successUrl': json['success_url'], 'trialEnd': (json['trial_end'] == null ? null : new Date(json['trial_end'])), 'trialFromPrice': json['trial_from_price'], 'trialPeriodDays': json['trial_period_days'], 'updatedAt': (new Date(json['updated_at'])), 'url': json['url'], }; } function PaymentLinkExternalToJSON(json) { return PaymentLinkExternalToJSONTyped(json, false); } function PaymentLinkExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'account_id': value['accountId'], 'account_name': value['accountName'], 'active': value['active'], 'checkout_preferences': (0, CheckoutPreferencesOutput_1.CheckoutPreferencesOutputToJSON)(value['checkoutPreferences']), 'coupon_id': value['couponId'], 'created_at': ((value['createdAt']).toISOString()), 'currency': value['currency'], 'custom_fields': value['customFields'], 'customer_email': value['customerEmail'], 'customer_id': value['customerId'], 'id': value['id'], 'is_deleted': value['isDeleted'], 'line_items': (value['lineItems'].map(PaymentLinkLineItemExternal_1.PaymentLinkLineItemExternalToJSON)), 'mode': (0, CheckoutMode_1.CheckoutModeToJSON)(value['mode']), 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'secure_token': value['secureToken'], 'success_url': value['successUrl'], 'trial_end': (value['trialEnd'] == null ? null : value['trialEnd'].toISOString()), 'trial_from_price': value['trialFromPrice'], 'trial_period_days': value['trialPeriodDays'], 'updated_at': ((value['updatedAt']).toISOString()), 'url': value['url'], }; }