wallee
Version:
TypeScript/JavaScript client for wallee
55 lines (54 loc) • 2.96 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfPaymentContract = instanceOfPaymentContract;
exports.PaymentContractFromJSON = PaymentContractFromJSON;
exports.PaymentContractFromJSONTyped = PaymentContractFromJSONTyped;
exports.PaymentContractToJSON = PaymentContractToJSON;
exports.PaymentContractToJSONTyped = PaymentContractToJSONTyped;
const PaymentContractState_1 = require("./PaymentContractState");
const FailureReason_1 = require("./FailureReason");
const PaymentContractType_1 = require("./PaymentContractType");
/**
* Check if a given object implements the PaymentContract interface.
*/
function instanceOfPaymentContract(value) {
return true;
}
function PaymentContractFromJSON(json) {
return PaymentContractFromJSONTyped(json, false);
}
function PaymentContractFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'contractType': json['contractType'] == null ? undefined : (0, PaymentContractType_1.PaymentContractTypeFromJSON)(json['contractType']),
'terminatedBy': json['terminatedBy'] == null ? undefined : json['terminatedBy'],
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'terminatedOn': json['terminatedOn'] == null ? undefined : (new Date(json['terminatedOn'])),
'activatedOn': json['activatedOn'] == null ? undefined : (new Date(json['activatedOn'])),
'startTerminatingOn': json['startTerminatingOn'] == null ? undefined : (new Date(json['startTerminatingOn'])),
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
'contractIdentifier': json['contractIdentifier'] == null ? undefined : json['contractIdentifier'],
'rejectedOn': json['rejectedOn'] == null ? undefined : (new Date(json['rejectedOn'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, PaymentContractState_1.PaymentContractStateFromJSON)(json['state']),
'rejectionReason': json['rejectionReason'] == null ? undefined : (0, FailureReason_1.FailureReasonFromJSON)(json['rejectionReason']),
'account': json['account'] == null ? undefined : json['account'],
};
}
function PaymentContractToJSON(json) {
return PaymentContractToJSONTyped(json, false);
}
function PaymentContractToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'contractType': (0, PaymentContractType_1.PaymentContractTypeToJSON)(value['contractType']),
'state': (0, PaymentContractState_1.PaymentContractStateToJSON)(value['state']),
'rejectionReason': (0, FailureReason_1.FailureReasonToJSON)(value['rejectionReason']),
};
}