wallee
Version:
TypeScript/JavaScript client for wallee
57 lines (56 loc) • 3.35 kB
JavaScript
import { TransactionFromJSON, TransactionToJSON, } from './Transaction';
import { FailureReasonFromJSON, FailureReasonToJSON, } from './FailureReason';
import { LabelFromJSON, } from './Label';
import { TransactionLineItemVersionStateFromJSON, TransactionLineItemVersionStateToJSON, } from './TransactionLineItemVersionState';
import { LineItemFromJSON, } from './LineItem';
/**
* Check if a given object implements the TransactionLineItemVersion interface.
*/
export function instanceOfTransactionLineItemVersion(value) {
return true;
}
export function TransactionLineItemVersionFromJSON(json) {
return TransactionLineItemVersionFromJSONTyped(json, false);
}
export 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(LabelFromJSON))),
'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(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 : FailureReasonFromJSON(json['failureReason']),
'succeededOn': json['succeededOn'] == null ? undefined : (new Date(json['succeededOn'])),
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : 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 : TransactionFromJSON(json['transaction']),
};
}
export function TransactionLineItemVersionToJSON(json) {
return TransactionLineItemVersionToJSONTyped(json, false);
}
export function TransactionLineItemVersionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'failureReason': FailureReasonToJSON(value['failureReason']),
'state': TransactionLineItemVersionStateToJSON(value['state']),
'transaction': TransactionToJSON(value['transaction']),
};
}