wallee
Version:
TypeScript/JavaScript client for wallee
46 lines (45 loc) • 2.29 kB
JavaScript
import { DunningFlowFromJSON, DunningFlowToJSON, } from './DunningFlow';
import { DunningCaseStateFromJSON, DunningCaseStateToJSON, } from './DunningCaseState';
import { TransactionInvoiceFromJSON, TransactionInvoiceToJSON, } from './TransactionInvoice';
/**
* Check if a given object implements the DunningCase interface.
*/
export function instanceOfDunningCase(value) {
return true;
}
export function DunningCaseFromJSON(json) {
return DunningCaseFromJSONTyped(json, false);
}
export function DunningCaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'canceledOn': json['canceledOn'] == null ? undefined : (new Date(json['canceledOn'])),
'derecognizedOn': json['derecognizedOn'] == null ? undefined : (new Date(json['derecognizedOn'])),
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'initialInvoice': json['initialInvoice'] == null ? undefined : TransactionInvoiceFromJSON(json['initialInvoice']),
'succeededOn': json['succeededOn'] == null ? undefined : (new Date(json['succeededOn'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : DunningCaseStateFromJSON(json['state']),
'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'],
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
'flow': json['flow'] == null ? undefined : DunningFlowFromJSON(json['flow']),
};
}
export function DunningCaseToJSON(json) {
return DunningCaseToJSONTyped(json, false);
}
export function DunningCaseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'initialInvoice': TransactionInvoiceToJSON(value['initialInvoice']),
'state': DunningCaseStateToJSON(value['state']),
'flow': DunningFlowToJSON(value['flow']),
};
}