/* tslint:disable */ /* eslint-disable */ /** * customfields * 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 { CustomFieldMeta } from '../models'; // @ts-ignore import type { ErrorResponse } from '../models'; /** * CustomFieldsApi - axios parameter creator */ export const CustomFieldsApiAxiosParamCreator = function ( configuration?: Configuration, ) { return { /** * * @summary Get custom field definition * @param {string} customfieldId The ID or encoded key of the custom field definition to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById: async ( customfieldId: string, detailsLevel?: GetByIdDetailsLevelEnum, options: RawAxiosRequestConfig = {}, ): Promise => { // verify required parameter 'customfieldId' is not null or undefined assertParamExists('getById', 'customfieldId', customfieldId); const localVarPath = `/customfields/{customfieldId}`.replace( `{${'customfieldId'}}`, encodeURIComponent(String(customfieldId)), ); // 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 (detailsLevel !== undefined) { localVarQueryParameter['detailsLevel'] = detailsLevel; } 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, }; }, }; }; /** * CustomFieldsApi - functional programming interface */ export const CustomFieldsApiFp = function (configuration?: Configuration) { const localVarAxiosParamCreator = CustomFieldsApiAxiosParamCreator(configuration); return { /** * * @summary Get custom field definition * @param {string} customfieldId The ID or encoded key of the custom field definition to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ async getById( customfieldId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): Promise< ( axios?: AxiosInstance, basePath?: string, ) => AxiosPromise > { const localVarAxiosArgs = await localVarAxiosParamCreator.getById( customfieldId, detailsLevel, options, ); const localVarOperationServerIndex = configuration?.serverIndex ?? 0; const localVarOperationServerBasePath = operationServerMap['CustomFieldsApi.getById']?.[ localVarOperationServerIndex ]?.url; return (axios, basePath) => createRequestFunction( localVarAxiosArgs, globalAxios, BASE_PATH, configuration, )(axios, localVarOperationServerBasePath || basePath); }, }; }; /** * CustomFieldsApi - factory interface */ export const CustomFieldsApiFactory = function ( configuration?: Configuration, basePath?: string, axios?: AxiosInstance, ) { const localVarFp = CustomFieldsApiFp(configuration); return { /** * * @summary Get custom field definition * @param {string} customfieldId The ID or encoded key of the custom field definition to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ getById( customfieldId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ): AxiosPromise { return localVarFp .getById(customfieldId, detailsLevel, options) .then((request) => request(axios, basePath)); }, }; }; /** * CustomFieldsApi - object-oriented interface */ export class CustomFieldsApi extends BaseAPI { /** * * @summary Get custom field definition * @param {string} customfieldId The ID or encoded key of the custom field definition to be returned. * @param {GetByIdDetailsLevelEnum} [detailsLevel] The level of details to return: `FULL` means the full details of the object will be returned (custom field values, address, contact info, or any other related objects) and `BASIC` will return only the first level elements of the object. * @param {*} [options] Override http request option. * @throws {RequiredError} */ public getById( customfieldId: string, detailsLevel?: GetByIdDetailsLevelEnum, options?: RawAxiosRequestConfig, ) { return CustomFieldsApiFp(this.configuration) .getById(customfieldId, detailsLevel, options) .then((request) => request(this.axios, this.basePath)); } } export const GetByIdDetailsLevelEnum = { Basic: 'BASIC', Full: 'FULL', } as const; export type GetByIdDetailsLevelEnum = (typeof GetByIdDetailsLevelEnum)[keyof typeof GetByIdDetailsLevelEnum];