wallee
Version:
TypeScript/JavaScript client for wallee
48 lines (47 loc) • 2.55 kB
JavaScript
import { PaymentContractStateFromJSON, PaymentContractStateToJSON, } from './PaymentContractState';
import { FailureReasonFromJSON, FailureReasonToJSON, } from './FailureReason';
import { PaymentContractTypeFromJSON, PaymentContractTypeToJSON, } from './PaymentContractType';
/**
* Check if a given object implements the PaymentContract interface.
*/
export function instanceOfPaymentContract(value) {
return true;
}
export function PaymentContractFromJSON(json) {
return PaymentContractFromJSONTyped(json, false);
}
export function PaymentContractFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'contractType': json['contractType'] == null ? undefined : 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 : PaymentContractStateFromJSON(json['state']),
'rejectionReason': json['rejectionReason'] == null ? undefined : FailureReasonFromJSON(json['rejectionReason']),
'account': json['account'] == null ? undefined : json['account'],
};
}
export function PaymentContractToJSON(json) {
return PaymentContractToJSONTyped(json, false);
}
export function PaymentContractToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'contractType': PaymentContractTypeToJSON(value['contractType']),
'state': PaymentContractStateToJSON(value['state']),
'rejectionReason': FailureReasonToJSON(value['rejectionReason']),
};
}