UNPKG

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

93 lines (92 loc) 6.11 kB
"use strict"; /* 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.BudgetDetailToJSONTyped = exports.BudgetDetailToJSON = exports.BudgetDetailFromJSONTyped = exports.BudgetDetailFromJSON = exports.instanceOfBudgetDetail = void 0; const PayeeLocation_1 = require("./PayeeLocation"); const Account_1 = require("./Account"); const ScheduledTransactionSummary_1 = require("./ScheduledTransactionSummary"); const Category_1 = require("./Category"); const CurrencyFormat_1 = require("./CurrencyFormat"); const DateFormat_1 = require("./DateFormat"); const SubTransaction_1 = require("./SubTransaction"); const MonthDetail_1 = require("./MonthDetail"); const Payee_1 = require("./Payee"); const ScheduledSubTransaction_1 = require("./ScheduledSubTransaction"); const TransactionSummary_1 = require("./TransactionSummary"); const CategoryGroup_1 = require("./CategoryGroup"); /** * Check if a given object implements the BudgetDetail interface. */ function instanceOfBudgetDetail(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; return true; } exports.instanceOfBudgetDetail = instanceOfBudgetDetail; function BudgetDetailFromJSON(json) { return BudgetDetailFromJSONTyped(json, false); } exports.BudgetDetailFromJSON = BudgetDetailFromJSON; function BudgetDetailFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['id'], 'name': json['name'], 'last_modified_on': json['last_modified_on'] == null ? undefined : json['last_modified_on'], 'first_month': json['first_month'] == null ? undefined : json['first_month'], 'last_month': json['last_month'] == null ? undefined : json['last_month'], 'date_format': json['date_format'] == null ? undefined : (0, DateFormat_1.DateFormatFromJSON)(json['date_format']), 'currency_format': json['currency_format'] == null ? undefined : (0, CurrencyFormat_1.CurrencyFormatFromJSON)(json['currency_format']), 'accounts': json['accounts'] == null ? undefined : (json['accounts'].map(Account_1.AccountFromJSON)), 'payees': json['payees'] == null ? undefined : (json['payees'].map(Payee_1.PayeeFromJSON)), 'payee_locations': json['payee_locations'] == null ? undefined : (json['payee_locations'].map(PayeeLocation_1.PayeeLocationFromJSON)), 'category_groups': json['category_groups'] == null ? undefined : (json['category_groups'].map(CategoryGroup_1.CategoryGroupFromJSON)), 'categories': json['categories'] == null ? undefined : (json['categories'].map(Category_1.CategoryFromJSON)), 'months': json['months'] == null ? undefined : (json['months'].map(MonthDetail_1.MonthDetailFromJSON)), 'transactions': json['transactions'] == null ? undefined : (json['transactions'].map(TransactionSummary_1.TransactionSummaryFromJSON)), 'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SubTransaction_1.SubTransactionFromJSON)), 'scheduled_transactions': json['scheduled_transactions'] == null ? undefined : (json['scheduled_transactions'].map(ScheduledTransactionSummary_1.ScheduledTransactionSummaryFromJSON)), 'scheduled_subtransactions': json['scheduled_subtransactions'] == null ? undefined : (json['scheduled_subtransactions'].map(ScheduledSubTransaction_1.ScheduledSubTransactionFromJSON)), }; } exports.BudgetDetailFromJSONTyped = BudgetDetailFromJSONTyped; function BudgetDetailToJSON(json) { return BudgetDetailToJSONTyped(json, false); } exports.BudgetDetailToJSON = BudgetDetailToJSON; function BudgetDetailToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'id': value['id'], 'name': value['name'], 'last_modified_on': value['last_modified_on'], 'first_month': value['first_month'], 'last_month': value['last_month'], 'date_format': (0, DateFormat_1.DateFormatToJSON)(value['date_format']), 'currency_format': (0, CurrencyFormat_1.CurrencyFormatToJSON)(value['currency_format']), 'accounts': value['accounts'] == null ? undefined : (value['accounts'].map(Account_1.AccountToJSON)), 'payees': value['payees'] == null ? undefined : (value['payees'].map(Payee_1.PayeeToJSON)), 'payee_locations': value['payee_locations'] == null ? undefined : (value['payee_locations'].map(PayeeLocation_1.PayeeLocationToJSON)), 'category_groups': value['category_groups'] == null ? undefined : (value['category_groups'].map(CategoryGroup_1.CategoryGroupToJSON)), 'categories': value['categories'] == null ? undefined : (value['categories'].map(Category_1.CategoryToJSON)), 'months': value['months'] == null ? undefined : (value['months'].map(MonthDetail_1.MonthDetailToJSON)), 'transactions': value['transactions'] == null ? undefined : (value['transactions'].map(TransactionSummary_1.TransactionSummaryToJSON)), 'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SubTransaction_1.SubTransactionToJSON)), 'scheduled_transactions': value['scheduled_transactions'] == null ? undefined : (value['scheduled_transactions'].map(ScheduledTransactionSummary_1.ScheduledTransactionSummaryToJSON)), 'scheduled_subtransactions': value['scheduled_subtransactions'] == null ? undefined : (value['scheduled_subtransactions'].map(ScheduledSubTransaction_1.ScheduledSubTransactionToJSON)), }; } exports.BudgetDetailToJSONTyped = BudgetDetailToJSONTyped;