UNPKG

@getopenpay/client

Version:

OpenPay API TypeScript SDK

83 lines (82 loc) 3.64 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.instanceOfPaymentMethodMappingExternal = instanceOfPaymentMethodMappingExternal; exports.PaymentMethodMappingExternalFromJSON = PaymentMethodMappingExternalFromJSON; exports.PaymentMethodMappingExternalFromJSONTyped = PaymentMethodMappingExternalFromJSONTyped; exports.PaymentMethodMappingExternalToJSON = PaymentMethodMappingExternalToJSON; exports.PaymentMethodMappingExternalToJSONTyped = PaymentMethodMappingExternalToJSONTyped; const PaymentProcessorName_1 = require("./PaymentProcessorName"); const ObjectName_1 = require("./ObjectName"); /** * Check if a given object implements the PaymentMethodMappingExternal interface. */ function instanceOfPaymentMethodMappingExternal(value) { if (!('createdAt' in value) || value['createdAt'] === undefined) return false; if (!('id' in value) || value['id'] === undefined) return false; if (!('paymentMethodId' in value) || value['paymentMethodId'] === undefined) return false; if (!('processorId' in value) || value['processorId'] === undefined) return false; if (!('processorName' in value) || value['processorName'] === undefined) return false; if (!('theirPaymentMethodId' in value) || value['theirPaymentMethodId'] === undefined) return false; if (!('updatedAt' in value) || value['updatedAt'] === undefined) return false; return true; } function PaymentMethodMappingExternalFromJSON(json) { return PaymentMethodMappingExternalFromJSONTyped(json, false); } function PaymentMethodMappingExternalFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'createdAt': (new Date(json['created_at'])), 'id': json['id'], 'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'], 'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']), 'paymentMethodId': json['payment_method_id'], 'processorId': json['processor_id'], 'processorMetadata': json['processor_metadata'] == null ? undefined : json['processor_metadata'], 'processorName': (0, PaymentProcessorName_1.PaymentProcessorNameFromJSON)(json['processor_name']), 'theirPaymentMethodId': json['their_payment_method_id'], 'updatedAt': (new Date(json['updated_at'])), }; } function PaymentMethodMappingExternalToJSON(json) { return PaymentMethodMappingExternalToJSONTyped(json, false); } function PaymentMethodMappingExternalToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'created_at': ((value['createdAt']).toISOString()), 'id': value['id'], 'is_deleted': value['isDeleted'], 'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']), 'payment_method_id': value['paymentMethodId'], 'processor_id': value['processorId'], 'processor_metadata': value['processorMetadata'], 'processor_name': (0, PaymentProcessorName_1.PaymentProcessorNameToJSON)(value['processorName']), 'their_payment_method_id': value['theirPaymentMethodId'], 'updated_at': ((value['updatedAt']).toISOString()), }; }