UNPKG

ynab

Version:

Official JavaScript client for the YNAB API. API documentation available at https://api.ynab.com. Generated from server specification version 1.85.0

92 lines (91 loc) 6.07 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.instanceOfPlanDetail = instanceOfPlanDetail; exports.PlanDetailFromJSON = PlanDetailFromJSON; exports.PlanDetailFromJSONTyped = PlanDetailFromJSONTyped; exports.PlanDetailToJSON = PlanDetailToJSON; exports.PlanDetailToJSONTyped = PlanDetailToJSONTyped; const MonthDetailBase_1 = require("./MonthDetailBase"); const PayeeLocation_1 = require("./PayeeLocation"); const CategoryBase_1 = require("./CategoryBase"); const CurrencyFormat_1 = require("./CurrencyFormat"); const DateFormat_1 = require("./DateFormat"); const SubTransactionBase_1 = require("./SubTransactionBase"); const ScheduledSubTransactionBase_1 = require("./ScheduledSubTransactionBase"); const ScheduledTransactionSummaryBase_1 = require("./ScheduledTransactionSummaryBase"); const TransactionSummaryBase_1 = require("./TransactionSummaryBase"); const Payee_1 = require("./Payee"); const AccountBase_1 = require("./AccountBase"); const CategoryGroup_1 = require("./CategoryGroup"); /** * Check if a given object implements the PlanDetail interface. */ function instanceOfPlanDetail(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('name' in value) || value['name'] === undefined) return false; return true; } function PlanDetailFromJSON(json) { return PlanDetailFromJSONTyped(json, false); } function PlanDetailFromJSONTyped(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(AccountBase_1.AccountBaseFromJSON)), '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(CategoryBase_1.CategoryBaseFromJSON)), 'months': json['months'] == null ? undefined : (json['months'].map(MonthDetailBase_1.MonthDetailBaseFromJSON)), 'transactions': json['transactions'] == null ? undefined : (json['transactions'].map(TransactionSummaryBase_1.TransactionSummaryBaseFromJSON)), 'subtransactions': json['subtransactions'] == null ? undefined : (json['subtransactions'].map(SubTransactionBase_1.SubTransactionBaseFromJSON)), 'scheduled_transactions': json['scheduled_transactions'] == null ? undefined : (json['scheduled_transactions'].map(ScheduledTransactionSummaryBase_1.ScheduledTransactionSummaryBaseFromJSON)), 'scheduled_subtransactions': json['scheduled_subtransactions'] == null ? undefined : (json['scheduled_subtransactions'].map(ScheduledSubTransactionBase_1.ScheduledSubTransactionBaseFromJSON)), }; } function PlanDetailToJSON(json) { return PlanDetailToJSONTyped(json, false); } function PlanDetailToJSONTyped(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(AccountBase_1.AccountBaseToJSON)), '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(CategoryBase_1.CategoryBaseToJSON)), 'months': value['months'] == null ? undefined : (value['months'].map(MonthDetailBase_1.MonthDetailBaseToJSON)), 'transactions': value['transactions'] == null ? undefined : (value['transactions'].map(TransactionSummaryBase_1.TransactionSummaryBaseToJSON)), 'subtransactions': value['subtransactions'] == null ? undefined : (value['subtransactions'].map(SubTransactionBase_1.SubTransactionBaseToJSON)), 'scheduled_transactions': value['scheduled_transactions'] == null ? undefined : (value['scheduled_transactions'].map(ScheduledTransactionSummaryBase_1.ScheduledTransactionSummaryBaseToJSON)), 'scheduled_subtransactions': value['scheduled_subtransactions'] == null ? undefined : (value['scheduled_subtransactions'].map(ScheduledSubTransactionBase_1.ScheduledSubTransactionBaseToJSON)), }; }