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
95 lines (94 loc) • 3.75 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)
*/
import { TransactionFlagColorFromJSON, TransactionFlagColorToJSON, } from './TransactionFlagColor';
/**
* @export
*/
export var 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.
*/
export 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;
}
export function ScheduledTransactionSummaryFromJSON(json) {
return ScheduledTransactionSummaryFromJSONTyped(json, false);
}
export 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 : 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'],
};
}
export function ScheduledTransactionSummaryToJSON(json) {
return ScheduledTransactionSummaryToJSONTyped(json, false);
}
export function ScheduledTransactionSummaryToJSONTyped(value, ignoreDiscriminator) {
if (ignoreDiscriminator === void 0) { 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': 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'],
};
}