wallee
Version:
TypeScript/JavaScript client for wallee
56 lines (55 loc) • 2.9 kB
JavaScript
import { AddressCreateFromJSON, AddressCreateToJSON, } from './AddressCreate';
import { LineItemCreateFromJSON, LineItemCreateToJSON, } from './LineItemCreate';
import { DebtCollectionEnvironmentFromJSON, DebtCollectionEnvironmentToJSON, } from './DebtCollectionEnvironment';
/**
* Check if a given object implements the DebtCollectionCaseCreate interface.
*/
export function instanceOfDebtCollectionCaseCreate(value) {
if (!('reference' in value) || value['reference'] === undefined)
return false;
if (!('externalId' in value) || value['externalId'] === undefined)
return false;
return true;
}
export function DebtCollectionCaseCreateFromJSON(json) {
return DebtCollectionCaseCreateFromJSONTyped(json, false);
}
export function DebtCollectionCaseCreateFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemCreateFromJSON)),
'contractDate': json['contractDate'] == null ? undefined : (new Date(json['contractDate'])),
'environment': json['environment'] == null ? undefined : DebtCollectionEnvironmentFromJSON(json['environment']),
'dueDate': json['dueDate'] == null ? undefined : (new Date(json['dueDate'])),
'currency': json['currency'] == null ? undefined : json['currency'],
'language': json['language'] == null ? undefined : json['language'],
'billingAddress': json['billingAddress'] == null ? undefined : AddressCreateFromJSON(json['billingAddress']),
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'reference': json['reference'],
'externalId': json['externalId'],
'collectorConfiguration': json['collectorConfiguration'] == null ? undefined : json['collectorConfiguration'],
};
}
export function DebtCollectionCaseCreateToJSON(json) {
return DebtCollectionCaseCreateToJSONTyped(json, false);
}
export function DebtCollectionCaseCreateToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'lineItems': value['lineItems'] == null ? undefined : (value['lineItems'].map(LineItemCreateToJSON)),
'contractDate': value['contractDate'] == null ? undefined : ((value['contractDate']).toISOString()),
'environment': DebtCollectionEnvironmentToJSON(value['environment']),
'dueDate': value['dueDate'] == null ? undefined : ((value['dueDate']).toISOString()),
'currency': value['currency'],
'language': value['language'],
'billingAddress': AddressCreateToJSON(value['billingAddress']),
'spaceViewId': value['spaceViewId'],
'reference': value['reference'],
'externalId': value['externalId'],
'collectorConfiguration': value['collectorConfiguration'],
};
}