/* eslint-disable */
// tslint:disable
/**
 * FastAPI
 *
 *
 * OpenAPI spec version: 0.1.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator+.
 * https://github.com/karlvr/openapi-generator-plus
 * Do not edit the class manually.
 */

import { Configuration } from "./configuration";
import { BASE_PATH, COLLECTION_FORMATS, FetchAPI, FetchArgs, BaseAPI, RequiredError, defaultFetch } from "./runtime";
import { Api } from "./models";

export type FactoryFunction<T> = (configuration?: Configuration, basePath?: string, fetch?: FetchAPI) => T;

/**
 * ApiApi - fetch parameter creator
 * @export
 */
export const ApiApiFetchParamCreator = function (configuration?: Configuration) {
	return {
		/**
		 * @summary Add
		 * @param {string} collectionId
		 * @param {Api.AddEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		add(collectionId: string, request: Api.AddEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling add.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling add.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/add`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Delete
		 * @param {string} collectionId
		 * @param {Api.DeleteEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		aDelete(collectionId: string, request: Api.DeleteEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling aDelete.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling aDelete.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/delete`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Get
		 * @param {string} collectionId
		 * @param {Api.GetEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		aGet(collectionId: string, request: Api.GetEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling aGet.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling aGet.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/get`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Count
		 * @param {string} collectionId
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		count(collectionId: string, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling count.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/count`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Create Collection
		 * @param {Api.CreateCollection} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		createCollection(request: Api.CreateCollection, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling createCollection.');
			}
			let localVarPath = `/api/v1/collections`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Delete Collection
		 * @param {string} collectionName
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		deleteCollection(collectionName: string, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionName' is not null or undefined
			if (collectionName === null || collectionName === undefined) {
				throw new RequiredError('collectionName', 'Required parameter collectionName was null or undefined when calling deleteCollection.');
			}
			let localVarPath = `/api/v1/collections/{collection_name}`
				.replace('{collection_name}', encodeURIComponent(String(collectionName)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'DELETE' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Get Collection
		 * @param {string} collectionName
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		getCollection(collectionName: string, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionName' is not null or undefined
			if (collectionName === null || collectionName === undefined) {
				throw new RequiredError('collectionName', 'Required parameter collectionName was null or undefined when calling getCollection.');
			}
			let localVarPath = `/api/v1/collections/{collection_name}`
				.replace('{collection_name}', encodeURIComponent(String(collectionName)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Get Nearest Neighbors
		 * @param {string} collectionId
		 * @param {Api.QueryEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		getNearestNeighbors(collectionId: string, request: Api.QueryEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling getNearestNeighbors.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling getNearestNeighbors.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/query`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Heartbeat
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		heartbeat(options: RequestInit = {}): FetchArgs {
			let localVarPath = `/api/v1/heartbeat`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary List Collections
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		listCollections(options: RequestInit = {}): FetchArgs {
			let localVarPath = `/api/v1/collections`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Reset
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		reset(options: RequestInit = {}): FetchArgs {
			let localVarPath = `/api/v1/reset`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Root
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		root(options: RequestInit = {}): FetchArgs {
			let localVarPath = `/api/v1`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Update
		 * @param {string} collectionId
		 * @param {Api.UpdateEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		update(collectionId: string, request: Api.UpdateEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling update.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling update.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/update`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Update Collection
		 * @param {string} collectionId
		 * @param {Api.UpdateCollection} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		updateCollection(collectionId: string, request: Api.UpdateCollection, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling updateCollection.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling updateCollection.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'PUT' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Upsert
		 * @param {string} collectionId
		 * @param {Api.AddEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		upsert(collectionId: string, request: Api.AddEmbedding, options: RequestInit = {}): FetchArgs {
			// verify required parameter 'collectionId' is not null or undefined
			if (collectionId === null || collectionId === undefined) {
				throw new RequiredError('collectionId', 'Required parameter collectionId was null or undefined when calling upsert.');
			}
			// verify required parameter 'request' is not null or undefined
			if (request === null || request === undefined) {
				throw new RequiredError('request', 'Required parameter request was null or undefined when calling upsert.');
			}
			let localVarPath = `/api/v1/collections/{collection_id}/upsert`
				.replace('{collection_id}', encodeURIComponent(String(collectionId)));
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'POST' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarHeaderParameter.set('Content-Type', 'application/json');

			localVarRequestOptions.headers = localVarHeaderParameter;

			if (request !== undefined) {
				localVarRequestOptions.body = JSON.stringify(request || {});
			}

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
		/**
		 * @summary Version
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		version(options: RequestInit = {}): FetchArgs {
			let localVarPath = `/api/v1/version`;
			const localVarPathQueryStart = localVarPath.indexOf("?");
			const localVarRequestOptions: RequestInit = Object.assign({ method: 'GET' }, options);
			const localVarHeaderParameter: Headers = options.headers ? new Headers(options.headers) : new Headers();
			const localVarQueryParameter = new URLSearchParams(localVarPathQueryStart !== -1 ? localVarPath.substring(localVarPathQueryStart + 1) : "");
			if (localVarPathQueryStart !== -1) {
				localVarPath = localVarPath.substring(0, localVarPathQueryStart);
			}

			localVarRequestOptions.headers = localVarHeaderParameter;

			const localVarQueryParameterString = localVarQueryParameter.toString();
			if (localVarQueryParameterString) {
				localVarPath += "?" + localVarQueryParameterString;
			}
			return {
				url: localVarPath,
				options: localVarRequestOptions,
			};
		},
	}
};

/**
 * ApiApi - functional programming interface
 * @export
 */
export const ApiApiFp = function(configuration?: Configuration) {
	return {
		/**
		 * @summary Add
		 * @param {string} collectionId
		 * @param {Api.AddEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		add(collectionId: string, request: Api.AddEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.Add201Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).add(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 201) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Delete
		 * @param {string} collectionId
		 * @param {Api.DeleteEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		aDelete(collectionId: string, request: Api.DeleteEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.ADelete200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).aDelete(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Get
		 * @param {string} collectionId
		 * @param {Api.GetEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		aGet(collectionId: string, request: Api.GetEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.AGet200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).aGet(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Count
		 * @param {string} collectionId
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		count(collectionId: string, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.Count200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).count(collectionId, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Create Collection
		 * @param {Api.CreateCollection} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		createCollection(request: Api.CreateCollection, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.CreateCollection200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).createCollection(request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Delete Collection
		 * @param {string} collectionName
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		deleteCollection(collectionName: string, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.DeleteCollection200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).deleteCollection(collectionName, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Get Collection
		 * @param {string} collectionName
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		getCollection(collectionName: string, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetCollection200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).getCollection(collectionName, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Get Nearest Neighbors
		 * @param {string} collectionId
		 * @param {Api.QueryEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		getNearestNeighbors(collectionId: string, request: Api.QueryEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.GetNearestNeighbors200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).getNearestNeighbors(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Heartbeat
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		heartbeat(options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<{ [name: string]: number }> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).heartbeat(options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary List Collections
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		listCollections(options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.ListCollections200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).listCollections(options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Reset
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		reset(options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<boolean> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).reset(options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Root
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		root(options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<{ [name: string]: number }> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).root(options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Update
		 * @param {string} collectionId
		 * @param {Api.UpdateEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		update(collectionId: string, request: Api.UpdateEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.Update200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).update(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Update Collection
		 * @param {string} collectionId
		 * @param {Api.UpdateCollection} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		updateCollection(collectionId: string, request: Api.UpdateCollection, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.UpdateCollection200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).updateCollection(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Upsert
		 * @param {string} collectionId
		 * @param {Api.AddEmbedding} request
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		upsert(collectionId: string, request: Api.AddEmbedding, options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<Api.Upsert200Response> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).upsert(collectionId, request, options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					if (response.status === 422) {
						if (mimeType === 'application/json') {
							throw response;
						}
						throw response;
					}
					throw response;
				});
			};
		},
		/**
		 * @summary Version
		 * @param {RequestInit} [options] Override http request option.
		 * @throws {RequiredError}
		 */
		version(options?: RequestInit): (fetch?: FetchAPI, basePath?: string) => Promise<string> {
			const localVarFetchArgs = ApiApiFetchParamCreator(configuration).version(options);
			return (fetch: FetchAPI = defaultFetch, basePath: string = BASE_PATH) => {
				return fetch(basePath + localVarFetchArgs.url, localVarFetchArgs.options).then((response) => {
					const contentType = response.headers.get('Content-Type');
					const mimeType = contentType ? contentType.replace(/;.*/, '') : undefined;

					if (response.status === 200) {
						if (mimeType === 'application/json') {
							return response.json() as any;
						}
						throw response;
					}
					throw response;
				});
			};
		},
	}
};

/**
 * ApiApi - factory interface
 * @export
 */
export const ApiApiFactory: FactoryFunction<ApiApi> = function (configuration?: Configuration, basePath?: string, fetch?: FetchAPI) {
	return new ApiApi(configuration, basePath, fetch);
};

/**
 * ApiApi - object-oriented interface
 * @export
 * @class ApiApi
 * @extends {BaseAPI}
 */
export class ApiApi extends BaseAPI {
	/**
	 * @summary Add
	 * @param {string} collectionId
	 * @param {Api.AddEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public add(collectionId: string, request: Api.AddEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).add(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Delete
	 * @param {string} collectionId
	 * @param {Api.DeleteEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public aDelete(collectionId: string, request: Api.DeleteEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).aDelete(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Get
	 * @param {string} collectionId
	 * @param {Api.GetEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public aGet(collectionId: string, request: Api.GetEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).aGet(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Count
	 * @param {string} collectionId
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public count(collectionId: string, options?: RequestInit) {
		return ApiApiFp(this.configuration).count(collectionId, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Create Collection
	 * @param {Api.CreateCollection} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public createCollection(request: Api.CreateCollection, options?: RequestInit) {
		return ApiApiFp(this.configuration).createCollection(request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Delete Collection
	 * @param {string} collectionName
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public deleteCollection(collectionName: string, options?: RequestInit) {
		return ApiApiFp(this.configuration).deleteCollection(collectionName, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Get Collection
	 * @param {string} collectionName
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public getCollection(collectionName: string, options?: RequestInit) {
		return ApiApiFp(this.configuration).getCollection(collectionName, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Get Nearest Neighbors
	 * @param {string} collectionId
	 * @param {Api.QueryEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public getNearestNeighbors(collectionId: string, request: Api.QueryEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).getNearestNeighbors(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Heartbeat
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public heartbeat(options?: RequestInit) {
		return ApiApiFp(this.configuration).heartbeat(options)(this.fetch, this.basePath);
	}

	/**
	 * @summary List Collections
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public listCollections(options?: RequestInit) {
		return ApiApiFp(this.configuration).listCollections(options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Reset
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public reset(options?: RequestInit) {
		return ApiApiFp(this.configuration).reset(options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Root
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public root(options?: RequestInit) {
		return ApiApiFp(this.configuration).root(options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Update
	 * @param {string} collectionId
	 * @param {Api.UpdateEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public update(collectionId: string, request: Api.UpdateEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).update(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Update Collection
	 * @param {string} collectionId
	 * @param {Api.UpdateCollection} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public updateCollection(collectionId: string, request: Api.UpdateCollection, options?: RequestInit) {
		return ApiApiFp(this.configuration).updateCollection(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Upsert
	 * @param {string} collectionId
	 * @param {Api.AddEmbedding} request
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public upsert(collectionId: string, request: Api.AddEmbedding, options?: RequestInit) {
		return ApiApiFp(this.configuration).upsert(collectionId, request, options)(this.fetch, this.basePath);
	}

	/**
	 * @summary Version
	 * @param {RequestInit} [options] Override http request option.
	 * @throws {RequiredError}
	 */
	public version(options?: RequestInit) {
		return ApiApiFp(this.configuration).version(options)(this.fetch, this.basePath);
	}

}

/**
 * We sometimes represent dates as strings (in models) and as Dates (in parameters) so this
 * function converts them both to a string.
 */
function dateToString(value: Date | string | undefined): string | undefined {
	if (value instanceof Date) {
		return value.toISOString();
	} else if (typeof value === 'string') {
		return value;
	} else {
		return undefined;
	}
}
