wallee
Version:
TypeScript/JavaScript client for wallee
53 lines (52 loc) • 3.09 kB
JavaScript
import { BankTransactionFlowDirectionFromJSON, BankTransactionFlowDirectionToJSON, } from './BankTransactionFlowDirection';
import { BankTransactionStateFromJSON, BankTransactionStateToJSON, } from './BankTransactionState';
import { CurrencyBankAccountFromJSON, CurrencyBankAccountToJSON, } from './CurrencyBankAccount';
import { PaymentAdjustmentFromJSON, } from './PaymentAdjustment';
/**
* Check if a given object implements the BankTransaction interface.
*/
export function instanceOfBankTransaction(value) {
return true;
}
export function BankTransactionFromJSON(json) {
return BankTransactionFromJSONTyped(json, false);
}
export function BankTransactionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'adjustments': json['adjustments'] == null ? undefined : (json['adjustments'].map(PaymentAdjustmentFromJSON)),
'currencyBankAccount': json['currencyBankAccount'] == null ? undefined : CurrencyBankAccountFromJSON(json['currencyBankAccount']),
'plannedPurgeDate': json['plannedPurgeDate'] == null ? undefined : (new Date(json['plannedPurgeDate'])),
'externalId': json['externalId'] == null ? undefined : json['externalId'],
'postingAmount': json['postingAmount'] == null ? undefined : json['postingAmount'],
'source': json['source'] == null ? undefined : json['source'],
'valueDate': json['valueDate'] == null ? undefined : (new Date(json['valueDate'])),
'type': json['type'] == null ? undefined : json['type'],
'createdOn': json['createdOn'] == null ? undefined : (new Date(json['createdOn'])),
'version': json['version'] == null ? undefined : json['version'],
'reference': json['reference'] == null ? undefined : json['reference'],
'linkedSpaceId': json['linkedSpaceId'] == null ? undefined : json['linkedSpaceId'],
'valueAmount': json['valueAmount'] == null ? undefined : json['valueAmount'],
'flowDirection': json['flowDirection'] == null ? undefined : BankTransactionFlowDirectionFromJSON(json['flowDirection']),
'createdBy': json['createdBy'] == null ? undefined : json['createdBy'],
'id': json['id'] == null ? undefined : json['id'],
'state': json['state'] == null ? undefined : BankTransactionStateFromJSON(json['state']),
'paymentDate': json['paymentDate'] == null ? undefined : (new Date(json['paymentDate'])),
'totalAdjustmentAmountIncludingTax': json['totalAdjustmentAmountIncludingTax'] == null ? undefined : json['totalAdjustmentAmountIncludingTax'],
};
}
export function BankTransactionToJSON(json) {
return BankTransactionToJSONTyped(json, false);
}
export function BankTransactionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'currencyBankAccount': CurrencyBankAccountToJSON(value['currencyBankAccount']),
'flowDirection': BankTransactionFlowDirectionToJSON(value['flowDirection']),
'state': BankTransactionStateToJSON(value['state']),
};
}