/* tslint:disable */ /* eslint-disable */ /** * indexratesources * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator) * * The version of the OpenAPI document: v2 * * * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). * https://openapi-generator.tech * Do not edit the class manually. */ import type { Configuration } from '../configuration'; import type { AxiosPromise, AxiosInstance, RawAxiosRequestConfig } from 'axios'; import globalAxios from 'axios'; // Some imports not used depending on template conditions // @ts-ignore import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction, replaceWithSerializableTypeIfNeeded, } from '../common'; // @ts-ignore import { BASE_PATH, COLLECTION_FORMATS, type RequestArgs, BaseAPI, RequiredError, operationServerMap, } from '../base'; // @ts-ignore import type { ErrorResponse } from '../models'; // @ts-ignore import type { IndexRateSource } from '../models'; /** * IndexRateSourcesApi - axios parameter creator */ export const IndexRateSourcesApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Create index rate source * @param {IndexRateSource} indexRateSource Index rate source to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createIndexRateSource: async ( indexRateSource: IndexRateSource, idempotencyKey?: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'indexRateSource' is not null or undefined assertParamExists( 'createIndexRateSource', 'indexRateSource', indexRateSource, ); const localVarPath = `/indexratesources`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'POST', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/json'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; if (idempotencyKey != null) { localVarHeaderParameter['Idempotency-Key'] = String(idempotencyKey); } setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( indexRateSource, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Delete index rate source * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteIndexRateSource: async ( indexRateSourceId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'indexRateSourceId' is not null or undefined assertParamExists( 'deleteIndexRateSource', 'indexRateSourceId', indexRateSourceId, ); const localVarPath = `/indexratesources/{indexRateSourceId}`.replace( `{${'indexRateSourceId'}}`, encodeURIComponent(String(indexRateSourceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'DELETE', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get index rate sources * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllIndexRateSources: async ( options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/indexratesources`; // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Get index rate sources * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIndexRateSourceById: async ( indexRateSourceId: string, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'indexRateSourceId' is not null or undefined assertParamExists( 'getIndexRateSourceById', 'indexRateSourceId', indexRateSourceId, ); const localVarPath = `/indexratesources/{indexRateSourceId}`.replace( `{${'indexRateSourceId'}}`, encodeURIComponent(String(indexRateSourceId)), ); // use dummy base URL string because the URL constructor only accepts absolute URLs. const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL); let baseOptions; if (configuration) { baseOptions = configuration.baseOptions; } const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+json'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * IndexRateSourcesApi - functional programming interface */ export const IndexRateSourcesApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = IndexRateSourcesApiAxiosParamCreator(configuration); return { /** * * @summary Create index rate source * @param {IndexRateSource} indexRateSource Index rate source to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async createIndexRateSource( indexRateSource: IndexRateSource, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.createIndexRateSource( indexRateSource, idempotencyKey, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['IndexRateSourcesApi.createIndexRateSource']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Delete index rate source * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async deleteIndexRateSource( indexRateSourceId: string, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.deleteIndexRateSource( indexRateSourceId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['IndexRateSourcesApi.deleteIndexRateSource']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get index rate sources * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getAllIndexRateSources( options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise> > { const localVarAxiosArgs = await localVarAxiosParamCreator.getAllIndexRateSources(options); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['IndexRateSourcesApi.getAllIndexRateSources']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Get index rate sources * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getIndexRateSourceById( indexRateSourceId: string, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getIndexRateSourceById( indexRateSourceId, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['IndexRateSourcesApi.getIndexRateSourceById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * IndexRateSourcesApi - factory interface */ export const IndexRateSourcesApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = IndexRateSourcesApiFp(configuration); return { /** * * @summary Create index rate source * @param {IndexRateSource} indexRateSource Index rate source to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ createIndexRateSource( indexRateSource: IndexRateSource, idempotencyKey?: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .createIndexRateSource(indexRateSource, idempotencyKey, options) .then((request) => request(axios, basePath)); }, /** * * @summary Delete index rate source * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ deleteIndexRateSource( indexRateSourceId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .deleteIndexRateSource(indexRateSourceId, options) .then((request) => request(axios, basePath)); }, /** * * @summary Get index rate sources * @param {*} [options] Override http request option. * @throws {RequiredError} */ getAllIndexRateSources( options?: RawAxiosRequestConfig, ): AxiosPromise> { return localVarFp .getAllIndexRateSources(options) .then((request) => request(axios, basePath)); }, /** * * @summary Get index rate sources * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getIndexRateSourceById( indexRateSourceId: string, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getIndexRateSourceById(indexRateSourceId, options) .then((request) => request(axios, basePath)); }, }; }; /** * IndexRateSourcesApi - object-oriented interface */ export class IndexRateSourcesApi extends BaseAPI { /** * * @summary Create index rate source * @param {IndexRateSource} indexRateSource Index rate source to be created. * @param {string} [idempotencyKey] Key that can be used to support idempotency on this POST. Must be a valid UUID(version 4 is recommended) string and can only be used with the exact same request. Can be used in retry mechanisms to prevent double posting. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public createIndexRateSource( indexRateSource: IndexRateSource, idempotencyKey?: string, options?: RawAxiosRequestConfig, ) { return IndexRateSourcesApiFp(this.configuration) .createIndexRateSource(indexRateSource, idempotencyKey, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Delete index rate source * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public deleteIndexRateSource( indexRateSourceId: string, options?: RawAxiosRequestConfig, ) { return IndexRateSourcesApiFp(this.configuration) .deleteIndexRateSource(indexRateSourceId, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get index rate sources * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getAllIndexRateSources(options?: RawAxiosRequestConfig) { return IndexRateSourcesApiFp(this.configuration) .getAllIndexRateSources(options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Get index rate sources * @param {string} indexRateSourceId The ID of the index rate source. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getIndexRateSourceById( indexRateSourceId: string, options?: RawAxiosRequestConfig, ) { return IndexRateSourcesApiFp(this.configuration) .getIndexRateSourceById(indexRateSourceId, options) .then((request) => request(this.axios, this.basePath)); } }