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

102 lines (101 loc) 4.48 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.ScheduledTransactionSummaryToJSONTyped = exports.ScheduledTransactionSummaryToJSON = exports.ScheduledTransactionSummaryFromJSONTyped = exports.ScheduledTransactionSummaryFromJSON = exports.instanceOfScheduledTransactionSummary = exports.ScheduledTransactionSummaryFrequencyEnum = void 0; const TransactionFlagColor_1 = require("./TransactionFlagColor"); /** * @export */ exports.ScheduledTransactionSummaryFrequencyEnum = { Never: 'never', Daily: 'daily', Weekly: 'weekly', EveryOtherWeek: 'everyOtherWeek', TwiceAMonth: 'twiceAMonth', Every4Weeks: 'every4Weeks', Monthly: 'monthly', EveryOtherMonth: 'everyOtherMonth', Every3Months: 'every3Months', Every4Months: 'every4Months', TwiceAYear: 'twiceAYear', Yearly: 'yearly', EveryOtherYear: 'everyOtherYear' }; /** * Check if a given object implements the ScheduledTransactionSummary interface. */ function instanceOfScheduledTransactionSummary(value) { if (!('id' in value) || value['id'] === undefined) return false; if (!('date_first' in value) || value['date_first'] === undefined) return false; if (!('date_next' in value) || value['date_next'] === undefined) return false; if (!('frequency' in value) || value['frequency'] === undefined) return false; if (!('amount' in value) || value['amount'] === undefined) return false; if (!('account_id' in value) || value['account_id'] === undefined) return false; if (!('deleted' in value) || value['deleted'] === undefined) return false; return true; } exports.instanceOfScheduledTransactionSummary = instanceOfScheduledTransactionSummary; function ScheduledTransactionSummaryFromJSON(json) { return ScheduledTransactionSummaryFromJSONTyped(json, false); } exports.ScheduledTransactionSummaryFromJSON = ScheduledTransactionSummaryFromJSON; function ScheduledTransactionSummaryFromJSONTyped(json, ignoreDiscriminator) { if (json == null) { return json; } return { 'id': json['id'], 'date_first': json['date_first'], 'date_next': json['date_next'], 'frequency': json['frequency'], 'amount': json['amount'], 'memo': json['memo'] == null ? undefined : json['memo'], 'flag_color': json['flag_color'] == null ? undefined : (0, TransactionFlagColor_1.TransactionFlagColorFromJSON)(json['flag_color']), 'flag_name': json['flag_name'] == null ? undefined : json['flag_name'], 'account_id': json['account_id'], 'payee_id': json['payee_id'] == null ? undefined : json['payee_id'], 'category_id': json['category_id'] == null ? undefined : json['category_id'], 'transfer_account_id': json['transfer_account_id'] == null ? undefined : json['transfer_account_id'], 'deleted': json['deleted'], }; } exports.ScheduledTransactionSummaryFromJSONTyped = ScheduledTransactionSummaryFromJSONTyped; function ScheduledTransactionSummaryToJSON(json) { return ScheduledTransactionSummaryToJSONTyped(json, false); } exports.ScheduledTransactionSummaryToJSON = ScheduledTransactionSummaryToJSON; function ScheduledTransactionSummaryToJSONTyped(value, ignoreDiscriminator = false) { if (value == null) { return value; } return { 'id': value['id'], 'date_first': value['date_first'], 'date_next': value['date_next'], 'frequency': value['frequency'], 'amount': value['amount'], 'memo': value['memo'], 'flag_color': (0, TransactionFlagColor_1.TransactionFlagColorToJSON)(value['flag_color']), 'flag_name': value['flag_name'], 'account_id': value['account_id'], 'payee_id': value['payee_id'], 'category_id': value['category_id'], 'transfer_account_id': value['transfer_account_id'], 'deleted': value['deleted'], }; } exports.ScheduledTransactionSummaryToJSONTyped = ScheduledTransactionSummaryToJSONTyped;