import Resource from './resources';
/**
* A Recurring Expense contains a summary of yearly recurring expenses Transactions in a Link
* @extends Resource
*/
class RecurringExpense extends Resource {
#endpoint = 'api/recurring-expenses/' // eslint-disable-line no-use-before-define
/**
* Retrieve recurring expenses information from a specific banking link.
*
* @async
* @param {string} link - UUID4 representation of a link Id.
* @param {object} options - Optional parameters (saveData)
* @returns {object} Response
* @throws {RequestError}
*/
async retrieve(link, options = {}) {
const {
saveData,
} = options;
const result = await this.session.post(this.#endpoint, {
link,
save_data: saveData,
});
return result;
}
}
export default RecurringExpense;