UNPKG

wallee

Version:
63 lines (62 loc) 3.39 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfDebtCollectionCaseCreate = instanceOfDebtCollectionCaseCreate; exports.DebtCollectionCaseCreateFromJSON = DebtCollectionCaseCreateFromJSON; exports.DebtCollectionCaseCreateFromJSONTyped = DebtCollectionCaseCreateFromJSONTyped; exports.DebtCollectionCaseCreateToJSON = DebtCollectionCaseCreateToJSON; exports.DebtCollectionCaseCreateToJSONTyped = DebtCollectionCaseCreateToJSONTyped; const AddressCreate_1 = require("./AddressCreate"); const LineItemCreate_1 = require("./LineItemCreate"); const DebtCollectionEnvironment_1 = require("./DebtCollectionEnvironment"); /** * Check if a given object implements the DebtCollectionCaseCreate interface. */ function instanceOfDebtCollectionCaseCreate(value) { if (!('reference' in value) || value['reference'] === undefined) return false; if (!('externalId' in value) || value['externalId'] === undefined) return false; return true; } function DebtCollectionCaseCreateFromJSON(json) { return DebtCollectionCaseCreateFromJSONTyped(json, false); } function DebtCollectionCaseCreateFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemCreate_1.LineItemCreateFromJSON)), 'contractDate': json['contractDate'] == null ? undefined : (new Date(json['contractDate'])), 'environment': json['environment'] == null ? undefined : (0, DebtCollectionEnvironment_1.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 : (0, AddressCreate_1.AddressCreateFromJSON)(json['billingAddress']), 'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'], 'reference': json['reference'], 'externalId': json['externalId'], 'collectorConfiguration': json['collectorConfiguration'] == null ? undefined : json['collectorConfiguration'], }; } function DebtCollectionCaseCreateToJSON(json) { return DebtCollectionCaseCreateToJSONTyped(json, false); } function DebtCollectionCaseCreateToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'lineItems': value['lineItems'] == null ? undefined : (value['lineItems'].map(LineItemCreate_1.LineItemCreateToJSON)), 'contractDate': value['contractDate'] == null ? undefined : ((value['contractDate']).toISOString()), 'environment': (0, DebtCollectionEnvironment_1.DebtCollectionEnvironmentToJSON)(value['environment']), 'dueDate': value['dueDate'] == null ? undefined : ((value['dueDate']).toISOString()), 'currency': value['currency'], 'language': value['language'], 'billingAddress': (0, AddressCreate_1.AddressCreateToJSON)(value['billingAddress']), 'spaceViewId': value['spaceViewId'], 'reference': value['reference'], 'externalId': value['externalId'], 'collectorConfiguration': value['collectorConfiguration'], }; }