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
102 lines (101 loc) • 4.32 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.ScheduledTransactionSummaryBaseFrequencyEnum = void 0;
exports.instanceOfScheduledTransactionSummaryBase = instanceOfScheduledTransactionSummaryBase;
exports.ScheduledTransactionSummaryBaseFromJSON = ScheduledTransactionSummaryBaseFromJSON;
exports.ScheduledTransactionSummaryBaseFromJSONTyped = ScheduledTransactionSummaryBaseFromJSONTyped;
exports.ScheduledTransactionSummaryBaseToJSON = ScheduledTransactionSummaryBaseToJSON;
exports.ScheduledTransactionSummaryBaseToJSONTyped = ScheduledTransactionSummaryBaseToJSONTyped;
const TransactionFlagColor_1 = require("./TransactionFlagColor");
/**
* @export
*/
exports.ScheduledTransactionSummaryBaseFrequencyEnum = {
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 ScheduledTransactionSummaryBase interface.
*/
function instanceOfScheduledTransactionSummaryBase(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;
}
function ScheduledTransactionSummaryBaseFromJSON(json) {
return ScheduledTransactionSummaryBaseFromJSONTyped(json, false);
}
function ScheduledTransactionSummaryBaseFromJSONTyped(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'],
};
}
function ScheduledTransactionSummaryBaseToJSON(json) {
return ScheduledTransactionSummaryBaseToJSONTyped(json, false);
}
function ScheduledTransactionSummaryBaseToJSONTyped(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'],
};
}