UNPKG

wallee

Version:
66 lines (65 loc) 3.92 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.instanceOfTransactionInvoice = instanceOfTransactionInvoice; exports.TransactionInvoiceFromJSON = TransactionInvoiceFromJSON; exports.TransactionInvoiceFromJSONTyped = TransactionInvoiceFromJSONTyped; exports.TransactionInvoiceToJSON = TransactionInvoiceToJSON; exports.TransactionInvoiceToJSONTyped = TransactionInvoiceToJSONTyped; const Address_1 = require("./Address"); const Environment_1 = require("./Environment"); const LineItem_1 = require("./LineItem"); const TransactionInvoiceState_1 = require("./TransactionInvoiceState"); const TransactionCompletion_1 = require("./TransactionCompletion"); /** * Check if a given object implements the TransactionInvoice interface. */ function instanceOfTransactionInvoice(value) { return true; } function TransactionInvoiceFromJSON(json) { return TransactionInvoiceFromJSONTyped(json, false); } function TransactionInvoiceFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'completion': json['completion'] == null ? undefined : (0, TransactionCompletion_1.TransactionCompletionFromJSON)(json['completion']), 'derecognizedOn': json['derecognizedOn'] == null ? undefined : (new Date(json['derecognizedOn'])), 'amount': json['amount'] == null ? undefined : json['amount'], 'dueOn': json['dueOn'] == null ? undefined : (new Date(json['dueOn'])), 'outstandingAmount': json['outstandingAmount'] == null ? undefined : json['outstandingAmount'], 'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])), 'externalId': json['externalId'] == null ? undefined : json['externalId'], 'timeZone': json['timeZone'] == null ? undefined : json['timeZone'], 'language': json['language'] == null ? undefined : json['language'], 'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'], 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'paidOn': json['paidOn'] == null ? undefined : (new Date(json['paidOn'])), 'version': json['version'] == null ? undefined : json['version'], 'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItem_1.LineItemFromJSON)), 'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'], 'environment': json['environment'] == null ? undefined : (0, Environment_1.EnvironmentFromJSON)(json['environment']), 'derecognizedBy': json['derecognizedBy'] == null ? undefined : json['derecognizedBy'], 'billingAddress': json['billingAddress'] == null ? undefined : (0, Address_1.AddressFromJSON)(json['billingAddress']), 'id': json['id'] == null ? undefined : json['id'], 'state': json['state'] == null ? undefined : (0, TransactionInvoiceState_1.TransactionInvoiceStateFromJSON)(json['state']), 'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'], 'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'], 'merchantReference': json['merchantReference'] == null ? undefined : json['merchantReference'], }; } function TransactionInvoiceToJSON(json) { return TransactionInvoiceToJSONTyped(json, false); } function TransactionInvoiceToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'completion': (0, TransactionCompletion_1.TransactionCompletionToJSON)(value['completion']), 'environment': (0, Environment_1.EnvironmentToJSON)(value['environment']), 'billingAddress': (0, Address_1.AddressToJSON)(value['billingAddress']), 'state': (0, TransactionInvoiceState_1.TransactionInvoiceStateToJSON)(value['state']), }; }