UNPKG

mx-platform-node

Version:

A Node library for the MX Platform API.

755 lines 786 kB
"use strict"; /* tslint:disable */ /* eslint-disable */ /** * MX Platform API * The MX Platform API is a powerful, fully-featured API designed to make aggregating and enhancing financial data easy and reliable. It can seamlessly connect your app or website to tens of thousands of financial institutions. * * The version of the OpenAPI document: 0.1.0 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.TransactionsApi = exports.TransactionsApiFactory = exports.TransactionsApiFp = exports.TransactionsApiAxiosParamCreator = exports.SpendingPlanApi = exports.SpendingPlanApiFactory = exports.SpendingPlanApiFp = exports.SpendingPlanApiAxiosParamCreator = exports.MxPlatformApi = exports.MxPlatformApiFactory = exports.MxPlatformApiFp = exports.MxPlatformApiAxiosParamCreator = exports.MicrodepositsApi = exports.MicrodepositsApiFactory = exports.MicrodepositsApiFp = exports.MicrodepositsApiAxiosParamCreator = exports.InsightsApi = exports.InsightsApiFactory = exports.InsightsApiFp = exports.InsightsApiAxiosParamCreator = exports.GoalsApi = exports.GoalsApiFactory = exports.GoalsApiFp = exports.GoalsApiAxiosParamCreator = exports.BudgetsApi = exports.BudgetsApiFactory = exports.BudgetsApiFp = exports.BudgetsApiAxiosParamCreator = exports.MemberResponseUseCasesEnum = void 0; const axios_1 = require("axios"); // Some imports not used depending on template conditions // @ts-ignore const common_1 = require("./common"); // @ts-ignore const base_1 = require("./base"); exports.MemberResponseUseCasesEnum = { MoneyMovement: 'MONEY_MOVEMENT', Pfm: 'PFM' }; /** * BudgetsApi - axios parameter creator * @export */ exports.BudgetsApiAxiosParamCreator = function (configuration) { return { /** * Delete a budget. * @summary Delete a budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidDelete: (userGuid, budgetGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidDelete', 'userGuid', userGuid); // verify required parameter 'budgetGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidDelete', 'budgetGuid', budgetGuid); const localVarPath = `/users/{user_guid}/budgets/{budget_guid}` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))) .replace(`{${"budget_guid"}}`, encodeURIComponent(String(budgetGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Read a specific budget. * @summary Read a specific budget * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidGet: (budgetGuid, userGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'budgetGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidGet', 'budgetGuid', budgetGuid); // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidGet', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/budgets/{budget_guid}` .replace(`{${"budget_guid"}}`, encodeURIComponent(String(budgetGuid))) .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Update a specific budget. * @summary Update a specific budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {BudgetUpdateRequestBody} [budgetUpdateRequestBody] * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidPut: (userGuid, budgetGuid, budgetUpdateRequestBody, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidPut', 'userGuid', userGuid); // verify required parameter 'budgetGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsBudgetGuidPut', 'budgetGuid', budgetGuid); const localVarPath = `/users/{user_guid}/budgets/{budget_guid}` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))) .replace(`{${"budget_guid"}}`, encodeURIComponent(String(budgetGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = common_1.serializeDataIfNeeded(budgetUpdateRequestBody, localVarRequestOptions, configuration); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren\'t enough transactions to automatically create any budgets`. * @summary Auto-generate budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGeneratePost: (userGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsGeneratePost', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/budgets/generate` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * List all budgets * @summary List all budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGet: (userGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsGet', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/budgets` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint. * @summary Create a budget * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {BudgetCreateRequestBody} budgetCreateRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsPost: (userGuid, budgetCreateRequestBody, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsPost', 'userGuid', userGuid); // verify required parameter 'budgetCreateRequestBody' is not null or undefined common_1.assertParamExists('usersUserGuidBudgetsPost', 'budgetCreateRequestBody', budgetCreateRequestBody); const localVarPath = `/users/{user_guid}/budgets` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = common_1.serializeDataIfNeeded(budgetCreateRequestBody, localVarRequestOptions, configuration); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * BudgetsApi - functional programming interface * @export */ exports.BudgetsApiFp = function (configuration) { const localVarAxiosParamCreator = exports.BudgetsApiAxiosParamCreator(configuration); return { /** * Delete a budget. * @summary Delete a budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Read a specific budget. * @summary Read a specific budget * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Update a specific budget. * @summary Update a specific budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {BudgetUpdateRequestBody} [budgetUpdateRequestBody] * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren\'t enough transactions to automatically create any budgets`. * @summary Auto-generate budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGeneratePost(userGuid, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsGeneratePost(userGuid, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * List all budgets * @summary List all budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGet(userGuid, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsGet(userGuid, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, /** * Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint. * @summary Create a budget * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {BudgetCreateRequestBody} budgetCreateRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options); return common_1.createRequestFunction(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration); }); }, }; }; /** * BudgetsApi - factory interface * @export */ exports.BudgetsApiFactory = function (configuration, basePath, axios) { const localVarFp = exports.BudgetsApiFp(configuration); return { /** * Delete a budget. * @summary Delete a budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options) { return localVarFp.usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options).then((request) => request(axios, basePath)); }, /** * Read a specific budget. * @summary Read a specific budget * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options) { return localVarFp.usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options).then((request) => request(axios, basePath)); }, /** * Update a specific budget. * @summary Update a specific budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {BudgetUpdateRequestBody} [budgetUpdateRequestBody] * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options) { return localVarFp.usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options).then((request) => request(axios, basePath)); }, /** * This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren\'t enough transactions to automatically create any budgets`. * @summary Auto-generate budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGeneratePost(userGuid, options) { return localVarFp.usersUserGuidBudgetsGeneratePost(userGuid, options).then((request) => request(axios, basePath)); }, /** * List all budgets * @summary List all budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsGet(userGuid, options) { return localVarFp.usersUserGuidBudgetsGet(userGuid, options).then((request) => request(axios, basePath)); }, /** * Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint. * @summary Create a budget * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {BudgetCreateRequestBody} budgetCreateRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options) { return localVarFp.usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options).then((request) => request(axios, basePath)); }, }; }; /** * BudgetsApi - object-oriented interface * @export * @class BudgetsApi * @extends {BaseAPI} */ class BudgetsApi extends base_1.BaseAPI { /** * Delete a budget. * @summary Delete a budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsBudgetGuidDelete(userGuid, budgetGuid, options).then((request) => request(this.axios, this.basePath)); } /** * Read a specific budget. * @summary Read a specific budget * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsBudgetGuidGet(budgetGuid, userGuid, options).then((request) => request(this.axios, this.basePath)); } /** * Update a specific budget. * @summary Update a specific budget * @param {string} userGuid The unique identifier for the budget. Defined by MX. * @param {string} budgetGuid The unique identifier for the budget. Defined by MX. * @param {BudgetUpdateRequestBody} [budgetUpdateRequestBody] * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsBudgetGuidPut(userGuid, budgetGuid, budgetUpdateRequestBody, options).then((request) => request(this.axios, this.basePath)); } /** * This endpoint will automatically create budgets for several categories based on existing transactions; these budgets are returned as an array. Specifically, budgets will only be generated if the `user` has at least one `transaction` in a given category during each of the two previous calendar months. For example, if the request is made on March 6, and there is at least one \"Bills & Utilities\" `transaction` in both January and February, a budget will be generated for \"Bills & Utilities.\" If there are two \"Bills & Utilities\" transactions in February but none in January, no budget will be generated for that category. If budgets already exist for particular categories, new budgets will be generated and returned based on the available transactions. If one or more budgets remain unchanged, they will nevertheless be returned in the response. If no transaction data for the `user` meet the above criteria, a `422 Unprocessable Entity` error will be returned with status code 4221 along with the message, `There aren\'t enough transactions to automatically create any budgets`. * @summary Auto-generate budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsGeneratePost(userGuid, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsGeneratePost(userGuid, options).then((request) => request(this.axios, this.basePath)); } /** * List all budgets * @summary List all budgets * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsGet(userGuid, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsGet(userGuid, options).then((request) => request(this.axios, this.basePath)); } /** * Create a budget. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. You cannot create a duplicate budget. For example, if you attempt to create a budget for \"Gas\", but that budget already exist, the request will fail. You can retrieve a list of all existing categories by using the List Categories endpoint. * @summary Create a budget * @param {string} userGuid The unique identifier for the user. Defined by MX. * @param {BudgetCreateRequestBody} budgetCreateRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof BudgetsApi */ usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options) { return exports.BudgetsApiFp(this.configuration).usersUserGuidBudgetsPost(userGuid, budgetCreateRequestBody, options).then((request) => request(this.axios, this.basePath)); } } exports.BudgetsApi = BudgetsApi; /** * GoalsApi - axios parameter creator * @export */ exports.GoalsApiAxiosParamCreator = function (configuration) { return { /** * List all goals a user can set. * @summary List goals * @param {string} userGuid The unique identifier for the user. * @param {string} [page] Results are returned in paginated sets, this is the page of the results you would like to view. Defaults to page 1 if no page is specified. * @param {string} [recordsPerAge] The supported range is from 10 to 1000. If the records_per_page parameter is not specified or is outside this range, a default of 25 records per page will be used. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsGet: (userGuid, page, recordsPerAge, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGet', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/goals` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); if (page !== undefined) { localVarQueryParameter['page'] = page; } if (recordsPerAge !== undefined) { localVarQueryParameter['records_per_age'] = recordsPerAge; } common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Delete a goal. * @summary Delete a goal * @param {string} goalGuid The unique identifier for a goal. Defined by MX. * @param {string} userGuid The unique identifier for a user. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsGoalGuidDelete: (goalGuid, userGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'goalGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidDelete', 'goalGuid', goalGuid); // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidDelete', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/goals/{goal_guid}` .replace(`{${"goal_guid"}}`, encodeURIComponent(String(goalGuid))) .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'DELETE' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Read a specific goal. * @summary Read a goal * @param {string} goalGuid The unique identifier for a goal. Defined by MX. * @param {string} userGuid The unique identifier for a user. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsGoalGuidGet: (goalGuid, userGuid, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'goalGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidGet', 'goalGuid', goalGuid); // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidGet', 'userGuid', userGuid); const localVarPath = `/users/{user_guid}/goals/{goal_guid}` .replace(`{${"goal_guid"}}`, encodeURIComponent(String(goalGuid))) .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'GET' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * This endpoint updates a specific goal. * @summary Update a goal * @param {string} goalGuid The unique identifier for a goal. Defined by MX. * @param {string} userGuid The unique identifier for a user. * @param {UpdateGoalRequestBody} updateGoalRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsGoalGuidPut: (goalGuid, userGuid, updateGoalRequestBody, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'goalGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidPut', 'goalGuid', goalGuid); // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidPut', 'userGuid', userGuid); // verify required parameter 'updateGoalRequestBody' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsGoalGuidPut', 'updateGoalRequestBody', updateGoalRequestBody); const localVarPath = `/users/{user_guid}/goals/{goal_guid}` .replace(`{${"goal_guid"}}`, encodeURIComponent(String(goalGuid))) .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = common_1.serializeDataIfNeeded(updateGoalRequestBody, localVarRequestOptions, configuration); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * Create a goal. This endpoint accepts the optional `MX-Skip-Webhook` header and `skip_webhook` parameter. * @summary Create a goal * @param {string} userGuid The unique identifier for the user. * @param {GoalRequestBody} goalRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsPost: (userGuid, goalRequestBody, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsPost', 'userGuid', userGuid); // verify required parameter 'goalRequestBody' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsPost', 'goalRequestBody', goalRequestBody); const localVarPath = `/users/{user_guid}/goals` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'POST' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = common_1.serializeDataIfNeeded(goalRequestBody, localVarRequestOptions, configuration); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), /** * This endpoint repositions goal priority levels. If one goal is set to a lower priority, then any other goals need to be adjusted accordingly. * @summary Reposition goals * @param {string} userGuid The unique identifier for the user. * @param {RepositionRequestBody} repositionRequestBody * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsRepositionPut: (userGuid, repositionRequestBody, options = {}) => __awaiter(this, void 0, void 0, function* () { // verify required parameter 'userGuid' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsRepositionPut', 'userGuid', userGuid); // verify required parameter 'repositionRequestBody' is not null or undefined common_1.assertParamExists('usersUserGuidGoalsRepositionPut', 'repositionRequestBody', repositionRequestBody); const localVarPath = `/users/{user_guid}/goals/reposition` .replace(`{${"user_guid"}}`, encodeURIComponent(String(userGuid))); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = Object.assign(Object.assign({ method: 'PUT' }, baseOptions), options); const localVarHeaderParameter = {}; const localVarQueryParameter = {}; // authentication basicAuth required // http basic authentication required common_1.setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; common_1.setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = Object.assign(Object.assign(Object.assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers); localVarRequestOptions.data = common_1.serializeDataIfNeeded(repositionRequestBody, localVarRequestOptions, configuration); return { url: common_1.toPathString(localVarUrlObj), options: localVarRequestOptions, }; }), }; }; /** * GoalsApi - functional programming interface * @export */ exports.GoalsApiFp = function (configuration) { const localVarAxiosParamCreator = exports.GoalsApiAxiosParamCreator(configuration); return { /** * List all goals a user can set. * @summary List goals * @param {string} userGuid The unique identifier for the user. * @param {string} [page] Results are returned in paginated sets, this is the page of the results you would like to view. Defaults to page 1 if no page is specified. * @param {string} [recordsPerAge] The supported range is from 10 to 1000. If the records_per_page parameter is not specified or is outside this range, a default of 25 records per page will be used. * @param {*} [options] Override http request option. * @throws {RequiredError} */ usersUserGuidGoalsGet(userGuid, page, recordsPerAge, options) { return __awaiter(this, void 0, void 0, function* () { const localVarAxiosArgs = yield localVarAxiosParamCreator.users