wallee
Version:
TypeScript/JavaScript client for wallee
72 lines (71 loc) • 4.79 kB
JavaScript
import { DebtCollectionCaseStateFromJSON, DebtCollectionCaseStateToJSON, } from './DebtCollectionCaseState';
import { AddressFromJSON, AddressToJSON, } from './Address';
import { FailureReasonFromJSON, FailureReasonToJSON, } from './FailureReason';
import { DebtCollectionCaseSourceFromJSON, DebtCollectionCaseSourceToJSON, } from './DebtCollectionCaseSource';
import { LabelFromJSON, } from './Label';
import { DebtCollectorConfigurationFromJSON, DebtCollectorConfigurationToJSON, } from './DebtCollectorConfiguration';
import { LineItemFromJSON, } from './LineItem';
import { DebtCollectionEnvironmentFromJSON, DebtCollectionEnvironmentToJSON, } from './DebtCollectionEnvironment';
/**
* Check if a given object implements the DebtCollectionCase interface.
*/
export function instanceOfDebtCollectionCase(value) {
return true;
}
export function DebtCollectionCaseFromJSON(json) {
return DebtCollectionCaseFromJSONTyped(json, false);
}
export function DebtCollectionCaseFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'contractDate': json['contractDate'] == null ? undefined : (new Date(json['contractDate'])),
'dueDate': json['dueDate'] == null ? undefined : (new Date(json['dueDate'])),
'closedOn': json['closedOn'] == null ? undefined : (new Date(json['closedOn'])),
'language': json['language'] == null ? undefined : json['language'],
'source': json['source'] == null ? undefined : DebtCollectionCaseSourceFromJSON(json['source']),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemFromJSON)),
'reference': json['reference'] == null ? undefined : json['reference'],
'currency': json['currency'] == null ? undefined : json['currency'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : DebtCollectionCaseStateFromJSON(json['state']),
'processingTimeoutOn': json['processingTimeoutOn'] == null ? undefined : (new Date(json['processingTimeoutOn'])),
'amount': json['amount'] == null ? undefined : json['amount'],
'creator': json['creator'] == null ? undefined : json['creator'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'collectorConfiguration': json['collectorConfiguration'] == null ? undefined : DebtCollectorConfigurationFromJSON(json['collectorConfiguration']),
'reviewer': json['reviewer'] == null ? undefined : json['reviewer'],
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'reviewStartedOn': json['reviewStartedOn'] == null ? undefined : (new Date(json['reviewStartedOn'])),
'version': json['version'] == null ? undefined : json['version'],
'labels': json['labels'] == null ? undefined : (new Set(json['labels'].map(LabelFromJSON))),
'processingStartedOn': json['processingStartedOn'] == null ? undefined : (new Date(json['processingStartedOn'])),
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'environment': json['environment'] == null ? undefined : DebtCollectionEnvironmentFromJSON(json['environment']),
'reviewedOn': json['reviewedOn'] == null ? undefined : (new Date(json['reviewedOn'])),
'sourceEntityId': json['sourceEntityId'] == null ? undefined : json['sourceEntityId'],
'failureReason': json['failureReason'] == null ? undefined : FailureReasonFromJSON(json['failureReason']),
'billingAddress': json['billingAddress'] == null ? undefined : AddressFromJSON(json['billingAddress']),
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
'nextAttemptOn': json['nextAttemptOn'] == null ? undefined : (new Date(json['nextAttemptOn'])),
};
}
export function DebtCollectionCaseToJSON(json) {
return DebtCollectionCaseToJSONTyped(json, false);
}
export function DebtCollectionCaseToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'source': DebtCollectionCaseSourceToJSON(value['source']),
'state': DebtCollectionCaseStateToJSON(value['state']),
'collectorConfiguration': DebtCollectorConfigurationToJSON(value['collectorConfiguration']),
'environment': DebtCollectionEnvironmentToJSON(value['environment']),
'failureReason': FailureReasonToJSON(value['failureReason']),
'billingAddress': AddressToJSON(value['billingAddress']),
};
}