wallee
Version:
TypeScript/JavaScript client for wallee
76 lines (75 loc) • 5.14 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfTransactionCompletion = instanceOfTransactionCompletion;
exports.TransactionCompletionFromJSON = TransactionCompletionFromJSON;
exports.TransactionCompletionFromJSONTyped = TransactionCompletionFromJSONTyped;
exports.TransactionCompletionToJSON = TransactionCompletionToJSON;
exports.TransactionCompletionToJSONTyped = TransactionCompletionToJSONTyped;
const TransactionCompletionState_1 = require("./TransactionCompletionState");
const FailureReason_1 = require("./FailureReason");
const Label_1 = require("./Label");
const LineItem_1 = require("./LineItem");
const TransactionCompletionMode_1 = require("./TransactionCompletionMode");
const TransactionLineItemVersion_1 = require("./TransactionLineItemVersion");
/**
* Check if a given object implements the TransactionCompletion interface.
*/
function instanceOfTransactionCompletion(value) {
return true;
}
function TransactionCompletionFromJSON(json) {
return TransactionCompletionFromJSONTyped(json, false);
}
function TransactionCompletionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'lineItemVersion': json['lineItemVersion'] == null ? undefined : (0, TransactionLineItemVersion_1.TransactionLineItemVersionFromJSON)(json['lineItemVersion']),
'statementDescriptor': json['statementDescriptor'] == null ? undefined : json['statementDescriptor'],
'baseLineItems': json['baseLineItems'] == null ? undefined : (json['baseLineItems'].map(LineItem_1.LineItemFromJSON)),
'processingOn': json['processingOn'] == null ? undefined : (new Date(json['processingOn'])),
'invoiceMerchantReference': json['invoiceMerchantReference'] == null ? undefined : json['invoiceMerchantReference'],
'language': json['language'] == null ? undefined : json['language'],
'remainingLineItems': json['remainingLineItems'] == null ? undefined : (json['remainingLineItems'].map(LineItem_1.LineItemFromJSON)),
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItem_1.LineItemFromJSON)),
'mode': json['mode'] == null ? undefined : (0, TransactionCompletionMode_1.TransactionCompletionModeFromJSON)(json['mode']),
'metaData': json['metaData'] == null ? undefined : json['metaData'],
'succeededOn': json['succeededOn'] == null ? undefined : (new Date(json['succeededOn'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : (0, TransactionCompletionState_1.TransactionCompletionStateFromJSON)(json['state']),
'linkedTransaction': json['linkedTransaction'] == null ? undefined : json['linkedTransaction'],
'paymentInformation': json['paymentInformation'] == null ? undefined : json['paymentInformation'],
'amount': json['amount'] == null ? undefined : json['amount'],
'lastCompletion': json['lastCompletion'] == null ? undefined : json['lastCompletion'],
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'timeZone': json['timeZone'] == null ? undefined : json['timeZone'],
'spaceViewId': json['spaceViewId'] == null ? undefined : json['spaceViewId'],
'version': json['version'] == null ? undefined : json['version'],
'labels': json['labels'] == null ? undefined : (new Set(json['labels'].map(Label_1.LabelFromJSON))),
'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']),
'taxAmount': json['taxAmount'] == null ? undefined : json['taxAmount'],
'failedOn': json['failedOn'] == null ? undefined : (new Date(json['failedOn'])),
'processorReference': json['processorReference'] == null ? undefined : json['processorReference'],
};
}
function TransactionCompletionToJSON(json) {
return TransactionCompletionToJSONTyped(json, false);
}
function TransactionCompletionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'lineItemVersion': (0, TransactionLineItemVersion_1.TransactionLineItemVersionToJSON)(value['lineItemVersion']),
'mode': (0, TransactionCompletionMode_1.TransactionCompletionModeToJSON)(value['mode']),
'state': (0, TransactionCompletionState_1.TransactionCompletionStateToJSON)(value['state']),
'failureReason': (0, FailureReason_1.FailureReasonToJSON)(value['failureReason']),
};
}