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

75 lines (74 loc) 2.96 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.instanceOfMonthDetailBase = instanceOfMonthDetailBase; exports.MonthDetailBaseFromJSON = MonthDetailBaseFromJSON; exports.MonthDetailBaseFromJSONTyped = MonthDetailBaseFromJSONTyped; exports.MonthDetailBaseToJSON = MonthDetailBaseToJSON; exports.MonthDetailBaseToJSONTyped = MonthDetailBaseToJSONTyped; const CategoryBase_1 = require("./CategoryBase"); /** * Check if a given object implements the MonthDetailBase interface. */ function instanceOfMonthDetailBase(value) { if (!('month' in value) || value['month'] === undefined) return false; if (!('income' in value) || value['income'] === undefined) return false; if (!('budgeted' in value) || value['budgeted'] === undefined) return false; if (!('activity' in value) || value['activity'] === undefined) return false; if (!('to_be_budgeted' in value) || value['to_be_budgeted'] === undefined) return false; if (!('deleted' in value) || value['deleted'] === undefined) return false; if (!('categories' in value) || value['categories'] === undefined) return false; return true; } function MonthDetailBaseFromJSON(json) { return MonthDetailBaseFromJSONTyped(json, false); } function MonthDetailBaseFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'month': json['month'], 'note': json['note'] == null ? undefined : json['note'], 'income': json['income'], 'budgeted': json['budgeted'], 'activity': json['activity'], 'to_be_budgeted': json['to_be_budgeted'], 'age_of_money': json['age_of_money'] == null ? undefined : json['age_of_money'], 'deleted': json['deleted'], 'categories': (json['categories'].map(CategoryBase_1.CategoryBaseFromJSON)), }; } function MonthDetailBaseToJSON(json) { return MonthDetailBaseToJSONTyped(json, false); } function MonthDetailBaseToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'month': value['month'], 'note': value['note'], 'income': value['income'], 'budgeted': value['budgeted'], 'activity': value['activity'], 'to_be_budgeted': value['to_be_budgeted'], 'age_of_money': value['age_of_money'], 'deleted': value['deleted'], 'categories': (value['categories'].map(CategoryBase_1.CategoryBaseToJSON)), }; }