UNPKG

@nikhil-patil/ngx-firefly-iii-api-client

Version:
1,001 lines 221 kB
/** * Firefly III API v2.1.0 * This is the documentation of the Firefly III API. You can find accompanying documentation on the website of Firefly III itself (see below). Please report any bugs or issues. You may use the \"Authorize\" button to try the API below. This file was last generated on 2024-05-19T04:33:01+00:00 Please keep in mind that the demo site does not accept requests from curl, colly, wget, etc. You must use a browser or a tool like Postman to make requests. Too many script kiddies out there, sorry about that. * * The version of the OpenAPI document: 2.1.0 * Contact: james@firefly-iii.org * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ /* tslint:disable:no-unused-variable member-ordering */ import { Inject, Injectable, Optional } from '@angular/core'; import { HttpClient, HttpHeaders, HttpParams, HttpContext } from '@angular/common/http'; import { CustomHttpParameterCodec } from '../encoder'; // @ts-ignore import { BASE_PATH } from '../variables'; import { HttpConfiguration } from '../configuration'; import * as i0 from "@angular/core"; import * as i1 from "@angular/common/http"; import * as i2 from "../configuration"; export class BudgetsService { constructor(httpClient, basePath, configuration) { this.httpClient = httpClient; this.basePath = 'https://demo.firefly-iii.org/api'; this.defaultHeaders = new HttpHeaders(); this.configuration = new HttpConfiguration(); if (configuration) { this.configuration = configuration; } if (typeof this.configuration.basePath !== 'string') { const firstBasePath = Array.isArray(basePath) ? basePath[0] : undefined; if (firstBasePath != undefined) { basePath = firstBasePath; } if (typeof basePath !== 'string') { basePath = this.basePath; } this.configuration.basePath = basePath; } this.encoder = this.configuration.encoder || new CustomHttpParameterCodec(); } // @ts-ignore addToHttpParams(httpParams, value, key) { if (typeof value === "object" && value instanceof Date === false) { httpParams = this.addToHttpParamsRecursive(httpParams, value); } else { httpParams = this.addToHttpParamsRecursive(httpParams, value, key); } return httpParams; } addToHttpParamsRecursive(httpParams, value, key) { if (value == null) { return httpParams; } if (typeof value === "object") { if (Array.isArray(value)) { value.forEach(elem => httpParams = this.addToHttpParamsRecursive(httpParams, elem, key)); } else if (value instanceof Date) { if (key != null) { httpParams = httpParams.append(key, value.toISOString().substring(0, 10)); } else { throw Error("key may not be null if value is Date"); } } else { Object.keys(value).forEach(k => httpParams = this.addToHttpParamsRecursive(httpParams, value[k], key != null ? `${key}.${k}` : k)); } } else if (key != null) { httpParams = httpParams.append(key, value); } else { throw Error("key may not be null if value is not object or array"); } return httpParams; } deleteBudget(id, xTraceId, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteBudget.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } deleteBudgetLimit(id, limitId, xTraceId, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling deleteBudgetLimit.'); } if (limitId === null || limitId === undefined) { throw new Error('Required parameter limitId was null or undefined when calling deleteBudgetLimit.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/limits/${this.configuration.encodeParam({ name: "limitId", value: limitId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; return this.httpClient.request('delete', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } getBudget(id, xTraceId, start, end, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getBudget.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (start !== undefined && start !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, start, 'start'); } if (end !== undefined && end !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, end, 'end'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } getBudgetLimit(id, limitId, xTraceId, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling getBudgetLimit.'); } if (limitId === null || limitId === undefined) { throw new Error('Required parameter limitId was null or undefined when calling getBudgetLimit.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/limits/${this.configuration.encodeParam({ name: "limitId", value: limitId, in: "path", style: "simple", explode: false, dataType: "number", dataFormat: undefined })}`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listAttachmentByBudget(id, xTraceId, limit, page, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling listAttachmentByBudget.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (limit !== undefined && limit !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, limit, 'limit'); } if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/attachments`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listBudget(xTraceId, limit, page, start, end, observe = 'body', reportProgress = false, options) { let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (limit !== undefined && limit !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, limit, 'limit'); } if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (start !== undefined && start !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, start, 'start'); } if (end !== undefined && end !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, end, 'end'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listBudgetLimit(start, end, xTraceId, observe = 'body', reportProgress = false, options) { if (start === null || start === undefined) { throw new Error('Required parameter start was null or undefined when calling listBudgetLimit.'); } if (end === null || end === undefined) { throw new Error('Required parameter end was null or undefined when calling listBudgetLimit.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (start !== undefined && start !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, start, 'start'); } if (end !== undefined && end !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, end, 'end'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budget-limits`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listBudgetLimitByBudget(id, xTraceId, start, end, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling listBudgetLimitByBudget.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (start !== undefined && start !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, start, 'start'); } if (end !== undefined && end !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, end, 'end'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/limits`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listTransactionByBudget(id, xTraceId, limit, page, start, end, type, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling listTransactionByBudget.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (limit !== undefined && limit !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, limit, 'limit'); } if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (start !== undefined && start !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, start, 'start'); } if (end !== undefined && end !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, end, 'end'); } if (type !== undefined && type !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, type, 'type'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/transactions`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } listTransactionByBudgetLimit(id, limitId, xTraceId, limit, page, type, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling listTransactionByBudgetLimit.'); } if (limitId === null || limitId === undefined) { throw new Error('Required parameter limitId was null or undefined when calling listTransactionByBudgetLimit.'); } let localVarQueryParameters = new HttpParams({ encoder: this.encoder }); if (limit !== undefined && limit !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, limit, 'limit'); } if (page !== undefined && page !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, page, 'page'); } if (type !== undefined && type !== null) { localVarQueryParameters = this.addToHttpParams(localVarQueryParameters, type, 'type'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/limits/${this.configuration.encodeParam({ name: "limitId", value: limitId, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/transactions`; return this.httpClient.request('get', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, params: localVarQueryParameters, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } storeBudget(budgetStore, xTraceId, observe = 'body', reportProgress = false, options) { if (budgetStore === null || budgetStore === undefined) { throw new Error('Required parameter budgetStore was null or undefined when calling storeBudget.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } // to determine the Content-Type header const consumes = [ 'application/json', 'application/x-www-form-urlencoded' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets`; return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: budgetStore, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } storeBudgetLimit(id, budgetLimitStore, xTraceId, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling storeBudgetLimit.'); } if (budgetLimitStore === null || budgetLimitStore === undefined) { throw new Error('Required parameter budgetLimitStore was null or undefined when calling storeBudgetLimit.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } // to determine the Content-Type header const consumes = [ 'application/json', 'application/x-www-form-urlencoded' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}/limits`; return this.httpClient.request('post', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: budgetLimitStore, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportProgress: reportProgress }); } updateBudget(id, budgetUpdate, xTraceId, observe = 'body', reportProgress = false, options) { if (id === null || id === undefined) { throw new Error('Required parameter id was null or undefined when calling updateBudget.'); } if (budgetUpdate === null || budgetUpdate === undefined) { throw new Error('Required parameter budgetUpdate was null or undefined when calling updateBudget.'); } let localVarHeaders = this.defaultHeaders; if (xTraceId !== undefined && xTraceId !== null) { localVarHeaders = localVarHeaders.set('X-Trace-Id', String(xTraceId)); } let localVarCredential; // authentication (firefly_iii_auth) required localVarCredential = this.configuration.lookupCredential('firefly_iii_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } // authentication (local_bearer_auth) required localVarCredential = this.configuration.lookupCredential('local_bearer_auth'); if (localVarCredential) { localVarHeaders = localVarHeaders.set('Authorization', 'Bearer ' + localVarCredential); } let localVarHttpHeaderAcceptSelected = options && options.httpHeaderAccept; if (localVarHttpHeaderAcceptSelected === undefined) { // to determine the Accept header const httpHeaderAccepts = [ 'application/vnd.api+json', 'application/json' ]; localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts); } if (localVarHttpHeaderAcceptSelected !== undefined) { localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected); } let localVarHttpContext = options && options.context; if (localVarHttpContext === undefined) { localVarHttpContext = new HttpContext(); } let localVarTransferCache = options && options.transferCache; if (localVarTransferCache === undefined) { localVarTransferCache = true; } // to determine the Content-Type header const consumes = [ 'application/json', 'application/x-www-form-urlencoded' ]; const httpContentTypeSelected = this.configuration.selectHeaderContentType(consumes); if (httpContentTypeSelected !== undefined) { localVarHeaders = localVarHeaders.set('Content-Type', httpContentTypeSelected); } let responseType_ = 'json'; if (localVarHttpHeaderAcceptSelected) { if (localVarHttpHeaderAcceptSelected.startsWith('text')) { responseType_ = 'text'; } else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) { responseType_ = 'json'; } else { responseType_ = 'blob'; } } let localVarPath = `/v1/budgets/${this.configuration.encodeParam({ name: "id", value: id, in: "path", style: "simple", explode: false, dataType: "string", dataFormat: undefined })}`; return this.httpClient.request('put', `${this.configuration.basePath}${localVarPath}`, { context: localVarHttpContext, body: budgetUpdate, responseType: responseType_, withCredentials: this.configuration.withCredentials, headers: localVarHeaders, observe: observe, transferCache: localVarTransferCache, reportP