/* tslint:disable */ /* eslint-disable */ /** * Estimations * Here you can find documentation and examples for Greenspark Estimations API * * OpenAPI spec version: v1 * * * NOTE: This class is auto generated by the swagger code generator program. * https://github.com/swagger-api/swagger-codegen.git * Do not edit the class manually. */ import globalAxios, { AxiosResponse, AxiosInstance, AxiosRequestConfig } from 'axios'; import { Configuration } from '../configuration'; // Some imports not used depending on template conditions // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base'; import { BulkEstimationsByCategoryTypeRequestBody } from '../models'; import { BulkEstimationsByMCCRequestBody } from '../models'; import { Estimation } from '../models'; import { EstimationsByCategoryTypeRequestBody } from '../models'; import { EstimationsByMCCRequestBody } from '../models'; /** * EstimationsApi - axios parameter creator * @export */ export const EstimationsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Estimating the carbon footprint of a transaction based on a Merchant Category Code * @summary Fetch Carbon Estimate of a Transaction by MCC * @param {EstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchCarbonEstimateOfATransactionByMCC: async (body: EstimationsByMCCRequestBody, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling fetchCarbonEstimateOfATransactionByMCC.'); } const localVarPath = `/v1/estimations/transaction/mcc`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication access-key required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("x-api-key") : await configuration.apiKey; localVarHeaderParameter["x-api-key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Estimating the carbon footprint of a transaction based on Open Banking Category Types * @summary Fetch Carbon Estimate of a Transaction by Open Banking Category Types * @param {EstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes: async (body: EstimationsByCategoryTypeRequestBody, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes.'); } const localVarPath = `/v1/estimations/transaction/category-type`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication access-key required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("x-api-key") : await configuration.apiKey; localVarHeaderParameter["x-api-key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Estimating the carbon footprint of multiple transactions based on a Merchant Category Code * @summary Fetch Carbon Estimate of Multiple Transactions by MCC * @param {BulkEstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchCarbonEstimateOfMultipleTransactionsByMCC: async (body: BulkEstimationsByMCCRequestBody, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling fetchCarbonEstimateOfMultipleTransactionsByMCC.'); } const localVarPath = `/v1/estimations/transaction/mcc/bulk`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication access-key required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("x-api-key") : await configuration.apiKey; localVarHeaderParameter["x-api-key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Estimating the carbon footprint of multiple transactions based on Open Banking Category Types * @summary Fetch Carbon Estimate of Multiple Transactions by Open Banking Category Types * @param {BulkEstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes: async (body: BulkEstimationsByCategoryTypeRequestBody, options: AxiosRequestConfig = {}): Promise => { // verify required parameter 'body' is not null or undefined if (body === null || body === undefined) { throw new RequiredError('body','Required parameter body was null or undefined when calling fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes.'); } const localVarPath = `/v1/estimations/transaction/category-type/bulk`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, 'https://example.com'); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options}; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication access-key required if (configuration && configuration.apiKey) { const localVarApiKeyValue = typeof configuration.apiKey === 'function' ? await configuration.apiKey("x-api-key") : await configuration.apiKey; localVarHeaderParameter["x-api-key"] = localVarApiKeyValue; } localVarHeaderParameter['Content-Type'] = 'application/json'; const query = new URLSearchParams(localVarUrlObj.search); for (const key in localVarQueryParameter) { query.set(key, localVarQueryParameter[key]); } for (const key in options.params) { query.set(key, options.params[key]); } localVarUrlObj.search = (new URLSearchParams(query)).toString(); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json'; localVarRequestOptions.data = needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || ""); return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, } }; /** * EstimationsApi - functional programming interface * @export */ export const EstimationsApiFp = function(configuration?: Configuration) { return { /** * Estimating the carbon footprint of a transaction based on a Merchant Category Code * @summary Fetch Carbon Estimate of a Transaction by MCC * @param {EstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfATransactionByMCC(body: EstimationsByMCCRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await EstimationsApiAxiosParamCreator(configuration).fetchCarbonEstimateOfATransactionByMCC(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Estimating the carbon footprint of a transaction based on Open Banking Category Types * @summary Fetch Carbon Estimate of a Transaction by Open Banking Category Types * @param {EstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body: EstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await EstimationsApiAxiosParamCreator(configuration).fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Estimating the carbon footprint of multiple transactions based on a Merchant Category Code * @summary Fetch Carbon Estimate of Multiple Transactions by MCC * @param {BulkEstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfMultipleTransactionsByMCC(body: BulkEstimationsByMCCRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await EstimationsApiAxiosParamCreator(configuration).fetchCarbonEstimateOfMultipleTransactionsByMCC(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, /** * Estimating the carbon footprint of multiple transactions based on Open Banking Category Types * @summary Fetch Carbon Estimate of Multiple Transactions by Open Banking Category Types * @param {BulkEstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body: BulkEstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise>> { const localVarAxiosArgs = await EstimationsApiAxiosParamCreator(configuration).fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body, options); return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => { const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url}; return axios.request(axiosRequestArgs); }; }, } }; /** * EstimationsApi - factory interface * @export */ export const EstimationsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { return { /** * Estimating the carbon footprint of a transaction based on a Merchant Category Code * @summary Fetch Carbon Estimate of a Transaction by MCC * @param {EstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfATransactionByMCC(body: EstimationsByMCCRequestBody, options?: AxiosRequestConfig): Promise> { return EstimationsApiFp(configuration).fetchCarbonEstimateOfATransactionByMCC(body, options).then((request) => request(axios, basePath)); }, /** * Estimating the carbon footprint of a transaction based on Open Banking Category Types * @summary Fetch Carbon Estimate of a Transaction by Open Banking Category Types * @param {EstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body: EstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig): Promise> { return EstimationsApiFp(configuration).fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body, options).then((request) => request(axios, basePath)); }, /** * Estimating the carbon footprint of multiple transactions based on a Merchant Category Code * @summary Fetch Carbon Estimate of Multiple Transactions by MCC * @param {BulkEstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfMultipleTransactionsByMCC(body: BulkEstimationsByMCCRequestBody, options?: AxiosRequestConfig): Promise> { return EstimationsApiFp(configuration).fetchCarbonEstimateOfMultipleTransactionsByMCC(body, options).then((request) => request(axios, basePath)); }, /** * Estimating the carbon footprint of multiple transactions based on Open Banking Category Types * @summary Fetch Carbon Estimate of Multiple Transactions by Open Banking Category Types * @param {BulkEstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} */ async fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body: BulkEstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig): Promise> { return EstimationsApiFp(configuration).fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body, options).then((request) => request(axios, basePath)); }, }; }; /** * EstimationsApi - object-oriented interface * @export * @class EstimationsApi * @extends {BaseAPI} */ export class EstimationsApi extends BaseAPI { /** * Estimating the carbon footprint of a transaction based on a Merchant Category Code * @summary Fetch Carbon Estimate of a Transaction by MCC * @param {EstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EstimationsApi */ public async fetchCarbonEstimateOfATransactionByMCC(body: EstimationsByMCCRequestBody, options?: AxiosRequestConfig) : Promise> { return EstimationsApiFp(this.configuration).fetchCarbonEstimateOfATransactionByMCC(body, options).then((request) => request(this.axios, this.basePath)); } /** * Estimating the carbon footprint of a transaction based on Open Banking Category Types * @summary Fetch Carbon Estimate of a Transaction by Open Banking Category Types * @param {EstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EstimationsApi */ public async fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body: EstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig) : Promise> { return EstimationsApiFp(this.configuration).fetchCarbonEstimateOfATransactionByOpenBankingCategoryTypes(body, options).then((request) => request(this.axios, this.basePath)); } /** * Estimating the carbon footprint of multiple transactions based on a Merchant Category Code * @summary Fetch Carbon Estimate of Multiple Transactions by MCC * @param {BulkEstimationsByMCCRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EstimationsApi */ public async fetchCarbonEstimateOfMultipleTransactionsByMCC(body: BulkEstimationsByMCCRequestBody, options?: AxiosRequestConfig) : Promise> { return EstimationsApiFp(this.configuration).fetchCarbonEstimateOfMultipleTransactionsByMCC(body, options).then((request) => request(this.axios, this.basePath)); } /** * Estimating the carbon footprint of multiple transactions based on Open Banking Category Types * @summary Fetch Carbon Estimate of Multiple Transactions by Open Banking Category Types * @param {BulkEstimationsByCategoryTypeRequestBody} body * @param {*} [options] Override http request option. * @throws {RequiredError} * @memberof EstimationsApi */ public async fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body: BulkEstimationsByCategoryTypeRequestBody, options?: AxiosRequestConfig) : Promise> { return EstimationsApiFp(this.configuration).fetchCarbonEstimateOfMultipleTransactionsByOpenBankingCategoryTypes(body, options).then((request) => request(this.axios, this.basePath)); } }