UNPKG

wallee

Version:
79 lines (78 loc) 5.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfDebtCollectionCase = instanceOfDebtCollectionCase; exports.DebtCollectionCaseFromJSON = DebtCollectionCaseFromJSON; exports.DebtCollectionCaseFromJSONTyped = DebtCollectionCaseFromJSONTyped; exports.DebtCollectionCaseToJSON = DebtCollectionCaseToJSON; exports.DebtCollectionCaseToJSONTyped = DebtCollectionCaseToJSONTyped; const DebtCollectionCaseState_1 = require("./DebtCollectionCaseState"); const Address_1 = require("./Address"); const FailureReason_1 = require("./FailureReason"); const DebtCollectionCaseSource_1 = require("./DebtCollectionCaseSource"); const Label_1 = require("./Label"); const DebtCollectorConfiguration_1 = require("./DebtCollectorConfiguration"); const LineItem_1 = require("./LineItem"); const DebtCollectionEnvironment_1 = require("./DebtCollectionEnvironment"); /** * Check if a given object implements the DebtCollectionCase interface. */ function instanceOfDebtCollectionCase(value) { return true; } function DebtCollectionCaseFromJSON(json) { return DebtCollectionCaseFromJSONTyped(json, false); } 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 : (0, DebtCollectionCaseSource_1.DebtCollectionCaseSourceFromJSON)(json['source']), 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItem_1.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 : (0, DebtCollectionCaseState_1.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 : (0, DebtCollectorConfiguration_1.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(Label_1.LabelFromJSON))), 'processingStartedOn': json['processingStartedOn'] == null ? undefined : (new Date(json['processingStartedOn'])), 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'environment': json['environment'] == null ? undefined : (0, DebtCollectionEnvironment_1.DebtCollectionEnvironmentFromJSON)(json['environment']), 'reviewedOn': json['reviewedOn'] == null ? undefined : (new Date(json['reviewedOn'])), 'sourceEntityId': json['sourceEntityId'] == null ? undefined : json['sourceEntityId'], 'failureReason': json['failureReason'] == null ? undefined : (0, FailureReason_1.FailureReasonFromJSON)(json['failureReason']), 'billingAddress': json['billingAddress'] == null ? undefined : (0, Address_1.AddressFromJSON)(json['billingAddress']), 'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])), 'nextAttemptOn': json['nextAttemptOn'] == null ? undefined : (new Date(json['nextAttemptOn'])), }; } function DebtCollectionCaseToJSON(json) { return DebtCollectionCaseToJSONTyped(json, false); } function DebtCollectionCaseToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'source': (0, DebtCollectionCaseSource_1.DebtCollectionCaseSourceToJSON)(value['source']), 'state': (0, DebtCollectionCaseState_1.DebtCollectionCaseStateToJSON)(value['state']), 'collectorConfiguration': (0, DebtCollectorConfiguration_1.DebtCollectorConfigurationToJSON)(value['collectorConfiguration']), 'environment': (0, DebtCollectionEnvironment_1.DebtCollectionEnvironmentToJSON)(value['environment']), 'failureReason': (0, FailureReason_1.FailureReasonToJSON)(value['failureReason']), 'billingAddress': (0, Address_1.AddressToJSON)(value['billingAddress']), }; }