wallee
Version:
TypeScript/JavaScript client for wallee
64 lines (63 loc) • 3.88 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfTransactionLineItemVersion = instanceOfTransactionLineItemVersion;
exports.TransactionLineItemVersionFromJSON = TransactionLineItemVersionFromJSON;
exports.TransactionLineItemVersionFromJSONTyped = TransactionLineItemVersionFromJSONTyped;
exports.TransactionLineItemVersionToJSON = TransactionLineItemVersionToJSON;
exports.TransactionLineItemVersionToJSONTyped = TransactionLineItemVersionToJSONTyped;
const Transaction_1 = require("./Transaction");
const FailureReason_1 = require("./FailureReason");
const Label_1 = require("./Label");
const TransactionLineItemVersionState_1 = require("./TransactionLineItemVersionState");
const LineItem_1 = require("./LineItem");
/**
* Check if a given object implements the TransactionLineItemVersion interface.
*/
function instanceOfTransactionLineItemVersion(value) {
return true;
}
function TransactionLineItemVersionFromJSON(json) {
return TransactionLineItemVersionFromJSONTyped(json, false);
}
function TransactionLineItemVersionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'amount': json['amount'] == null ? undefined : json['amount'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'processingOn': json['processingOn'] == null ? undefined : (new Date(json['processingOn'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'language': json['language'] == null ? undefined : json['language'],
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'labels': json['labels'] == null ? undefined : (new Set(json['labels'].map(Label_1.LabelFromJSON))),
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItem_1.LineItemFromJSON)),
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'timeoutOn': json['timeoutOn'] == null ? undefined : (new Date(json['timeoutOn'])),
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
'nextUpdateOn': json['nextUpdateOn'] == null ? undefined : (new Date(json['nextUpdateOn'])),
'failureReason': json['failureReason'] == null ? undefined : (0, FailureReason_1.FailureReasonFromJSON)(json['failureReason']),
'succeededOn': json['succeededOn'] == null ? undefined : (new Date(json['succeededOn'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, TransactionLineItemVersionState_1.TransactionLineItemVersionStateFromJSON)(json['state']),
'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'],
'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'],
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
'transaction': json['transaction'] == null ? undefined : (0, Transaction_1.TransactionFromJSON)(json['transaction']),
};
}
function TransactionLineItemVersionToJSON(json) {
return TransactionLineItemVersionToJSONTyped(json, false);
}
function TransactionLineItemVersionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'failureReason': (0, FailureReason_1.FailureReasonToJSON)(value['failureReason']),
'state': (0, TransactionLineItemVersionState_1.TransactionLineItemVersionStateToJSON)(value['state']),
'transaction': (0, Transaction_1.TransactionToJSON)(value['transaction']),
};
}