/* tslint:disable */ /* eslint-disable */ /** * configuration/clientroles.yaml * 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 { ClientsRolesConfiguration } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * ClientRolesConfigurationApi - axios parameter creator */ export const ClientRolesConfigurationApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get client roles configuration * @param {Array} [type] The account holder type for which the client roles are returned. If the parameter is absent, all the clients roles are returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ get: async ( type?: Array, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/configuration/clientroles.yaml`; // 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); if (type) { localVarQueryParameter['type'] = type; } localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+yaml'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, /** * * @summary Update client roles configuration * @param {ClientsRolesConfiguration} [clientsRolesConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ update: async ( clientsRolesConfiguration?: ClientsRolesConfiguration, options: RawAxiosRequestConfig = {}, ): Promise => { const localVarPath = `/configuration/clientroles.yaml`; // 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: 'PUT', ...baseOptions, ...options, }; const localVarHeaderParameter = {} as any; const localVarQueryParameter = {} as any; // authentication basic required // http basic authentication required setBasicAuthToObject(localVarRequestOptions, configuration); localVarHeaderParameter['Content-Type'] = 'application/yaml'; localVarHeaderParameter['Accept'] = 'application/vnd.mambu.v2+yaml'; setSearchParams(localVarUrlObj, localVarQueryParameter); let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; localVarRequestOptions.headers = { ...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers, }; localVarRequestOptions.data = serializeDataIfNeeded( clientsRolesConfiguration, localVarRequestOptions, configuration, ); return { url: toPathString(localVarUrlObj), options: localVarRequestOptions, }; }, }; }; /** * ClientRolesConfigurationApi - functional programming interface */ export const ClientRolesConfigurationApiFp = function ( configuration?: Configuration, ) { const localVarAxiosParamCreator = ClientRolesConfigurationApiAxiosParamCreator(configuration); return { /** * * @summary Get client roles configuration * @param {Array} [type] The account holder type for which the client roles are returned. If the parameter is absent, all the clients roles are returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async get( type?: Array, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.get( type, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ClientRolesConfigurationApi.get']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, /** * * @summary Update client roles configuration * @param {ClientsRolesConfiguration} [clientsRolesConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ async update( clientsRolesConfiguration?: ClientsRolesConfiguration, options?: RawAxiosRequestConfig, ): Promise< (axios?: AxiosInstance, basePath?: string) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.update( clientsRolesConfiguration, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['ClientRolesConfigurationApi.update']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * ClientRolesConfigurationApi - factory interface */ export const ClientRolesConfigurationApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = ClientRolesConfigurationApiFp(configuration); return { /** * * @summary Get client roles configuration * @param {Array} [type] The account holder type for which the client roles are returned. If the parameter is absent, all the clients roles are returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ get( type?: Array, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .get(type, options) .then((request) => request(axios, basePath)); }, /** * * @summary Update client roles configuration * @param {ClientsRolesConfiguration} [clientsRolesConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ update( clientsRolesConfiguration?: ClientsRolesConfiguration, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .update(clientsRolesConfiguration, options) .then((request) => request(axios, basePath)); }, }; }; /** * ClientRolesConfigurationApi - object-oriented interface */ export class ClientRolesConfigurationApi extends BaseAPI { /** * * @summary Get client roles configuration * @param {Array} [type] The account holder type for which the client roles are returned. If the parameter is absent, all the clients roles are returned. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public get(type?: Array, options?: RawAxiosRequestConfig) { return ClientRolesConfigurationApiFp(this.configuration) .get(type, options) .then((request) => request(this.axios, this.basePath)); } /** * * @summary Update client roles configuration * @param {ClientsRolesConfiguration} [clientsRolesConfiguration] * @param {*} [options] Override http request option. * @throws {RequiredError} */ public update( clientsRolesConfiguration?: ClientsRolesConfiguration, options?: RawAxiosRequestConfig, ) { return ClientRolesConfigurationApiFp(this.configuration) .update(clientsRolesConfiguration, options) .then((request) => request(this.axios, this.basePath)); } } export const GetTypeEnum = { Client: 'CLIENT', Group: 'GROUP', } as const; export type GetTypeEnum = (typeof GetTypeEnum)[keyof typeof GetTypeEnum];