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
100 lines (99 loc) • 4.58 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.AccountToJSONTyped = exports.AccountToJSON = exports.AccountFromJSONTyped = exports.AccountFromJSON = exports.instanceOfAccount = void 0;
const AccountType_1 = require("./AccountType");
/**
* Check if a given object implements the Account interface.
*/
function instanceOfAccount(value) {
if (!('id' in value) || value['id'] === undefined)
return false;
if (!('name' in value) || value['name'] === undefined)
return false;
if (!('type' in value) || value['type'] === undefined)
return false;
if (!('on_budget' in value) || value['on_budget'] === undefined)
return false;
if (!('closed' in value) || value['closed'] === undefined)
return false;
if (!('balance' in value) || value['balance'] === undefined)
return false;
if (!('cleared_balance' in value) || value['cleared_balance'] === undefined)
return false;
if (!('uncleared_balance' in value) || value['uncleared_balance'] === undefined)
return false;
if (!('transfer_payee_id' in value) || value['transfer_payee_id'] === undefined)
return false;
if (!('deleted' in value) || value['deleted'] === undefined)
return false;
return true;
}
exports.instanceOfAccount = instanceOfAccount;
function AccountFromJSON(json) {
return AccountFromJSONTyped(json, false);
}
exports.AccountFromJSON = AccountFromJSON;
function AccountFromJSONTyped(json, ignoreDiscriminator) {
if (json == null) {
return json;
}
return {
'id': json['id'],
'name': json['name'],
'type': (0, AccountType_1.AccountTypeFromJSON)(json['type']),
'on_budget': json['on_budget'],
'closed': json['closed'],
'note': json['note'] == null ? undefined : json['note'],
'balance': json['balance'],
'cleared_balance': json['cleared_balance'],
'uncleared_balance': json['uncleared_balance'],
'transfer_payee_id': json['transfer_payee_id'],
'direct_import_linked': json['direct_import_linked'] == null ? undefined : json['direct_import_linked'],
'direct_import_in_error': json['direct_import_in_error'] == null ? undefined : json['direct_import_in_error'],
'last_reconciled_at': json['last_reconciled_at'] == null ? undefined : json['last_reconciled_at'],
'debt_original_balance': json['debt_original_balance'] == null ? undefined : json['debt_original_balance'],
'debt_interest_rates': json['debt_interest_rates'] == null ? undefined : json['debt_interest_rates'],
'debt_minimum_payments': json['debt_minimum_payments'] == null ? undefined : json['debt_minimum_payments'],
'debt_escrow_amounts': json['debt_escrow_amounts'] == null ? undefined : json['debt_escrow_amounts'],
'deleted': json['deleted'],
};
}
exports.AccountFromJSONTyped = AccountFromJSONTyped;
function AccountToJSON(json) {
return AccountToJSONTyped(json, false);
}
exports.AccountToJSON = AccountToJSON;
function AccountToJSONTyped(value, ignoreDiscriminator = false) {
if (value == null) {
return value;
}
return {
'id': value['id'],
'name': value['name'],
'type': (0, AccountType_1.AccountTypeToJSON)(value['type']),
'on_budget': value['on_budget'],
'closed': value['closed'],
'note': value['note'],
'balance': value['balance'],
'cleared_balance': value['cleared_balance'],
'uncleared_balance': value['uncleared_balance'],
'transfer_payee_id': value['transfer_payee_id'],
'direct_import_linked': value['direct_import_linked'],
'direct_import_in_error': value['direct_import_in_error'],
'last_reconciled_at': value['last_reconciled_at'],
'debt_original_balance': value['debt_original_balance'],
'debt_interest_rates': value['debt_interest_rates'],
'debt_minimum_payments': value['debt_minimum_payments'],
'debt_escrow_amounts': value['debt_escrow_amounts'],
'deleted': value['deleted'],
};
}
exports.AccountToJSONTyped = AccountToJSONTyped;