ynab
Version:
Official JavaScript client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.76.0
68 lines (67 loc) • 3.6 kB
JavaScript
;
/* tslint:disable */
/* eslint-disable */
/**
* YNAB API Endpoints
* Our API uses a REST based design, leverages the JSON data format, and relies upon HTTPS for transport. We respond with meaningful HTTP response codes and if an error occurs, we include error details in the response body. API Documentation is at https://api.ynab.com
*
* Generated by: OpenAPI Generator (https://openapi-generator.tech)
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.ExistingTransactionToJSONTyped = exports.ExistingTransactionToJSON = exports.ExistingTransactionFromJSONTyped = exports.ExistingTransactionFromJSON = exports.instanceOfExistingTransaction = void 0;
const TransactionFlagColor_1 = require("./TransactionFlagColor");
const TransactionClearedStatus_1 = require("./TransactionClearedStatus");
const SaveSubTransaction_1 = require("./SaveSubTransaction");
/**
* Check if a given object implements the ExistingTransaction interface.
*/
function instanceOfExistingTransaction(value) {
return true;
}
exports.instanceOfExistingTransaction = instanceOfExistingTransaction;
function ExistingTransactionFromJSON(json) {
return ExistingTransactionFromJSONTyped(json, false);
}
exports.ExistingTransactionFromJSON = ExistingTransactionFromJSON;
function ExistingTransactionFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'account_id': json['account_id'] == null ? undefined : json['account_id'],
'date': json['date'] == null ? undefined : json['date'],
'amount': json['amount'] == null ? undefined : json['amount'],
'payee_id': json['payee_id'] == null ? undefined : json['payee_id'],
'payee_name': json['payee_name'] == null ? undefined : json['payee_name'],
'category_id': json['category_id'] == null ? undefined : json['category_id'],
'memo': json['memo'] == null ? undefined : json['memo'],
'cleared': json['cleared'] == null ? undefined : (0, TransactionClearedStatus_1.TransactionClearedStatusFromJSON)(json['cleared']),
'approved': json['approved'] == null ? undefined : json['approved'],
'flag_color': json['flag_color'] == null ? undefined : (0, TransactionFlagColor_1.TransactionFlagColorFromJSON)(json['flag_color']),
'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SaveSubTransaction_1.SaveSubTransactionFromJSON)),
};
}
exports.ExistingTransactionFromJSONTyped = ExistingTransactionFromJSONTyped;
function ExistingTransactionToJSON(json) {
return ExistingTransactionToJSONTyped(json, false);
}
exports.ExistingTransactionToJSON = ExistingTransactionToJSON;
function ExistingTransactionToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'account_id': value['account_id'],
'date': value['date'],
'amount': value['amount'],
'payee_id': value['payee_id'],
'payee_name': value['payee_name'],
'category_id': value['category_id'],
'memo': value['memo'],
'cleared': (0, TransactionClearedStatus_1.TransactionClearedStatusToJSON)(value['cleared']),
'approved': value['approved'],
'flag_color': (0, TransactionFlagColor_1.TransactionFlagColorToJSON)(value['flag_color']),
'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SaveSubTransaction_1.SaveSubTransactionToJSON)),
};
}
exports.ExistingTransactionToJSONTyped = ExistingTransactionToJSONTyped;