wallee
Version:
TypeScript/JavaScript client for wallee
50 lines (49 loc) • 2.52 kB
JavaScript
import { AddressCreateFromJSON, AddressCreateToJSON, } from './AddressCreate';
import { LineItemCreateFromJSON, LineItemCreateToJSON, } from './LineItemCreate';
import { DebtCollectionEnvironmentFromJSON, DebtCollectionEnvironmentToJSON, } from './DebtCollectionEnvironment';
/**
* Check if a given object implements the DebtCollectionCaseUpdate interface.
*/
export function instanceOfDebtCollectionCaseUpdate(value) {
if (!('version' in value) || value['version'] === undefined)
return false;
return true;
}
export function DebtCollectionCaseUpdateFromJSON(json) {
return DebtCollectionCaseUpdateFromJSONTyped(json, false);
}
export function DebtCollectionCaseUpdateFromJSONTyped(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'],
'version': json['version'],
};
}
export function DebtCollectionCaseUpdateToJSON(json) {
return DebtCollectionCaseUpdateToJSONTyped(json, false);
}
export function DebtCollectionCaseUpdateToJSONTyped(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'],
'version': value['version'],
};
}