UNPKG

@getgreenspark/reports

Version:
1,012 lines (898 loc) 106 kB
/* tslint:disable */ /* eslint-disable */ /** * Reporting * Here you can find documentation and examples for Greenspark Reporting 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 { InlineResponse200 } from '../models'; import { InlineResponse2001 } from '../models'; import { InlineResponse2002 } from '../models'; import { InlineResponse2003 } from '../models'; import { InlineResponse2004 } from '../models'; import { InlineResponse2005 } from '../models'; import { InlineResponse2006 } from '../models'; import { InlineResponse2007 } from '../models'; import { InlineResponse2008 } from '../models'; import { RawReport } from '../models'; import { RawReportV2 } from '../models'; /** * ReportsApi - axios parameter creator * @export */ export const ReportsApiAxiosParamCreator = function (configuration?: Configuration) { return { /** * Fetch your impacts page in a raw format. * @summary Fetch a Report Page * @param {string} reportId The id of a previously generated report. * @param {string} cursor The cursor identifies the next page within a report. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchAReportPage: async (reportId: string, cursor: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { // verify required parameter 'reportId' is not null or undefined if (reportId === null || reportId === undefined) { throw new RequiredError('reportId','Required parameter reportId was null or undefined when calling fetchAReportPage.'); } // verify required parameter 'cursor' is not null or undefined if (cursor === null || cursor === undefined) { throw new RequiredError('cursor','Required parameter cursor was null or undefined when calling fetchAReportPage.'); } const localVarPath = `/v1/reports/{reportId}/{cursor}` .replace(`{${"reportId"}}`, encodeURIComponent(String(reportId))) .replace(`{${"cursor"}}`, encodeURIComponent(String(cursor))); // 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: 'GET', ...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; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of average spending on impacts per currency. * @summary Fetch Average Spend Per Impact * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchAverageSpendPerImpact: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/average-spend-per-impact`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts of carbon per month. * @summary Fetch Carbon By Interval * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchCarbonByInterval: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/carbon-by-interval`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts on a single type and source. * @summary Fetch Impact Amount By Type Per Source Report * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchImpactAmountByTypePerSourceReport: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/impact-amount-by-type-per-source`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts on a single type and trigger. * @summary Fetch Impact Amount By Type Per Trigger Report * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchImpactAmountByTypePerTriggerReport: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/impact-amount-by-type-per-trigger`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts per month. * @summary Fetch Impacts By Interval * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchImpactsByInterval: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/impacts-by-interval`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts of plastic per month. * @summary Fetch Plastic By Interval * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchPlasticByInterval: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/plastic-by-interval`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch your impacts in a raw format. * @summary Fetch Raw Report * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {string} [impactType] Type can be trees, plastic or carbon. As a result only the impacts containing the provided impact type will be returned. If they contain other impact types as well, those won&#x27;t be filtered out. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchRawReport: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, impactType?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } if (impactType !== undefined) { localVarQueryParameter['impactType'] = impactType; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch your impacts in a raw format. * @summary Fetch Raw Report v2 * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {string} [impactType] Type can be trees, plastic or carbon. As a result only the impacts containing the provided impact type will be returned. If they contain other impact types as well, those won&#x27;t be filtered out. * @param {string} [cursor] The cursor identifies the next page within a report. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchRawReportV2: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, impactType?: string, cursor?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v2/reports`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } if (impactType !== undefined) { localVarQueryParameter['impactType'] = impactType; } if (cursor !== undefined) { localVarQueryParameter['cursor'] = cursor; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of impacts amount per source. * @summary Fetch Total Impact By Sources * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTotalImpactBySources: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/total-impact-by-sources`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of impacts amount per trigger. * @summary Fetch Total Impact By Triggers * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTotalImpactByTriggers: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/total-impact-by-triggers`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts on a single type. * @summary Fetch Total Impact By Type Report * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTotalImpactByTypeReport: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/total-impact-by-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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the total number of impacts. * @summary Fetch Total Impacts Count * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTotalImpactsCount: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/total-impacts-count`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of total spending on impacts per currency. * @summary Fetch Total Spend On Impacts * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTotalSpendOnImpacts: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/total-spend-on-impacts`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) { localVarQueryParameter['triggerId'] = triggerId; } if (startDate !== undefined) { localVarQueryParameter['startDate'] = startDate; } if (endDate !== undefined) { localVarQueryParameter['endDate'] = endDate; } if (metadata !== undefined) { localVarQueryParameter['metadata'] = metadata; } 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}; return { url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash, options: localVarRequestOptions, }; }, /** * Fetch the Array of spending on impacts of trees per month. * @summary Fetch Trees By Interval * @param {string} [sourceId] The id of the source associated with the impact. * @param {string} [triggerId] The id of the trigger associated with the impact. * @param {string} [startDate] The beginning of the date filter interval. * @param {string} [endDate] The end of the date filter interval. * @param {string} [metadata] You can filter the data by the provided key-value pairs as Metadata. * @param {*} [options] Override http request option. * @throws {RequiredError} */ fetchTreesByInterval: async (sourceId?: string, triggerId?: string, startDate?: string, endDate?: string, metadata?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => { const localVarPath = `/v1/reports/trees-by-interval`; // 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: 'GET', ...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; } if (sourceId !== undefined) { localVarQueryParameter['sourceId'] = sourceId; } if (triggerId !== undefined) {