@getopenpay/client
Version:
OpenPay API TypeScript SDK
84 lines (83 loc) • 3.28 kB
JavaScript
;
/* 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.instanceOfDisputeExternal = instanceOfDisputeExternal;
exports.DisputeExternalFromJSON = DisputeExternalFromJSON;
exports.DisputeExternalFromJSONTyped = DisputeExternalFromJSONTyped;
exports.DisputeExternalToJSON = DisputeExternalToJSON;
exports.DisputeExternalToJSONTyped = DisputeExternalToJSONTyped;
const ObjectName_1 = require("./ObjectName");
/**
* Check if a given object implements the DisputeExternal interface.
*/
function instanceOfDisputeExternal(value) {
if (!('accountId' in value) || value['accountId'] === undefined)
return false;
if (!('createdAt' in value) || value['createdAt'] === undefined)
return false;
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('paymentIntentId' in value) || value['paymentIntentId'] === undefined)
return false;
if (!('theirDisputeId' in value) || value['theirDisputeId'] === undefined)
return false;
if (!('theirPaymentIntentId' in value) || value['theirPaymentIntentId'] === undefined)
return false;
if (!('updatedAt' in value) || value['updatedAt'] === undefined)
return false;
return true;
}
function DisputeExternalFromJSON(json) {
return DisputeExternalFromJSONTyped(json, false);
}
function DisputeExternalFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'accountId': json['account_id'],
'createdAt': (new Date(json['created_at'])),
'id': json['id'],
'isDeleted': json['is_deleted'] == null ? undefined : json['is_deleted'],
'metadata': json['metadata'] == null ? undefined : json['metadata'],
'object': json['object'] == null ? undefined : (0, ObjectName_1.ObjectNameFromJSON)(json['object']),
'paymentIntentId': json['payment_intent_id'],
'reason': json['reason'] == null ? undefined : json['reason'],
'theirDisputeId': json['their_dispute_id'],
'theirPaymentIntentId': json['their_payment_intent_id'],
'updatedAt': (new Date(json['updated_at'])),
};
}
function DisputeExternalToJSON(json) {
return DisputeExternalToJSONTyped(json, false);
}
function DisputeExternalToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'account_id': value['accountId'],
'created_at': ((value['createdAt']).toISOString()),
'id': value['id'],
'is_deleted': value['isDeleted'],
'metadata': value['metadata'],
'object': (0, ObjectName_1.ObjectNameToJSON)(value['object']),
'payment_intent_id': value['paymentIntentId'],
'reason': value['reason'],
'their_dispute_id': value['theirDisputeId'],
'their_payment_intent_id': value['theirPaymentIntentId'],
'updated_at': ((value['updatedAt']).toISOString()),
};
}