UNPKG

wallee

Version:
69 lines (68 loc) 4.61 kB
import { TransactionCompletionStateFromJSON, TransactionCompletionStateToJSON, } from './TransactionCompletionState'; import { FailureReasonFromJSON, FailureReasonToJSON, } from './FailureReason'; import { LabelFromJSON, } from './Label'; import { LineItemFromJSON, } from './LineItem'; import { TransactionCompletionModeFromJSON, TransactionCompletionModeToJSON, } from './TransactionCompletionMode'; import { TransactionLineItemVersionFromJSON, TransactionLineItemVersionToJSON, } from './TransactionLineItemVersion'; /** * Check if a given object implements the TransactionCompletion interface. */ export function instanceOfTransactionCompletion(value) { return true; } export function TransactionCompletionFromJSON(json) { return TransactionCompletionFromJSONTyped(json, false); } export function TransactionCompletionFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'lineItemVersion': json['lineItemVersion'] == null ? undefined : TransactionLineItemVersionFromJSON(json['lineItemVersion']), 'statementDescriptor': json['statementDescriptor'] == null ? undefined : json['statementDescriptor'], 'baseLineItems': json['baseLineItems'] == null ? undefined : (json['baseLineItems'].map(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(LineItemFromJSON)), 'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])), 'lineItems': json['lineItems'] == null ? undefined : (json['lineItems'].map(LineItemFromJSON)), 'mode': json['mode'] == null ? undefined : 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 : 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(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 : 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'], }; } export function TransactionCompletionToJSON(json) { return TransactionCompletionToJSONTyped(json, false); } export function TransactionCompletionToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'lineItemVersion': TransactionLineItemVersionToJSON(value['lineItemVersion']), 'mode': TransactionCompletionModeToJSON(value['mode']), 'state': TransactionCompletionStateToJSON(value['state']), 'failureReason': FailureReasonToJSON(value['failureReason']), }; }