UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

76 lines (75 loc) 2.87 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.instanceOfSetupIntentExternal = instanceOfSetupIntentExternal; exports.SetupIntentExternalFromJSON = SetupIntentExternalFromJSON; exports.SetupIntentExternalFromJSONTyped = SetupIntentExternalFromJSONTyped; exports.SetupIntentExternalToJSON = SetupIntentExternalToJSON; exports.SetupIntentExternalToJSONTyped = SetupIntentExternalToJSONTyped; const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the SetupIntentExternal interface. */ function instanceOfSetupIntentExternal(value) { if (!('accountId' in value) || value['accountId'] === undefined) return false; if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('customerId' in value) || value['customerId'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('paymentMethodIds' in value) || value['paymentMethodIds'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } function SetupIntentExternalFromJSON(json) { return SetupIntentExternalFromJSONTyped(json, false); } function SetupIntentExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'accountId': json['account_id'], 'createdAt': (new Date(json['created_at'])), 'customerId': json['customer_id'], 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'paymentMethodIds': json['payment_method_ids'], 'updatedAt': (new Date(json['updated_at'])), }; } function SetupIntentExternalToJSON(json) { return SetupIntentExternalToJSONTyped(json, false); } function SetupIntentExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'account_id': value['accountId'], 'created_at': ((value['createdAt']).toISOString()), 'customer_id': value['customerId'], 'id': value['id'], 'is_deleted': value['isDeleted'], 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'payment_method_ids': value['paymentMethodIds'], 'updated_at': ((value['updatedAt']).toISOString()), }; }