/* tslint:disable */
/* eslint-disable */
/**
 * Daytona Toolbox API
 * Daytona Toolbox API
 *
 * The version of the OpenAPI document: v0.0.0-dev
 * 
 *
 * 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 { GitAddRequest } from '../models';
// @ts-ignore
import type { GitBranchRequest } from '../models';
// @ts-ignore
import type { GitCheckoutRequest } from '../models';
// @ts-ignore
import type { GitCloneRequest } from '../models';
// @ts-ignore
import type { GitCommitInfo } from '../models';
// @ts-ignore
import type { GitCommitRequest } from '../models';
// @ts-ignore
import type { GitCommitResponse } from '../models';
// @ts-ignore
import type { GitDeleteBranchRequest } from '../models';
// @ts-ignore
import type { GitRepoRequest } from '../models';
// @ts-ignore
import type { GitStatus } from '../models';
// @ts-ignore
import type { ListBranchResponse } from '../models';
/**
 * GitApi - axios parameter creator
 */
export const GitApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Add files to the Git staging area
         * @summary Add files to Git staging
         * @param {GitAddRequest} request Add files request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addFiles: async (request: GitAddRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('addFiles', 'request', request)
            const localVarPath = `/git/add`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Switch to a different branch or commit in the Git repository
         * @summary Checkout branch or commit
         * @param {GitCheckoutRequest} request Checkout request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkoutBranch: async (request: GitCheckoutRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('checkoutBranch', 'request', request)
            const localVarPath = `/git/checkout`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Clone a Git repository to the specified path
         * @summary Clone a Git repository
         * @param {GitCloneRequest} request Clone repository request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cloneRepository: async (request: GitCloneRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('cloneRepository', 'request', request)
            const localVarPath = `/git/clone`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Commit staged changes to the Git repository
         * @summary Commit changes
         * @param {GitCommitRequest} request Commit request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        commitChanges: async (request: GitCommitRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('commitChanges', 'request', request)
            const localVarPath = `/git/commit`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';
            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Create a new branch in the Git repository
         * @summary Create a new branch
         * @param {GitBranchRequest} request Create branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBranch: async (request: GitBranchRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('createBranch', 'request', request)
            const localVarPath = `/git/branches`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Delete a branch from the Git repository
         * @summary Delete a branch
         * @param {GitDeleteBranchRequest} request Delete branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteBranch: async (request: GitDeleteBranchRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('deleteBranch', 'request', request)
            const localVarPath = `/git/branches`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get the commit history of the Git repository
         * @summary Get commit history
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCommitHistory: async (path: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'path' is not null or undefined
            assertParamExists('getCommitHistory', 'path', path)
            const localVarPath = `/git/history`;
            // 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;

            if (path !== undefined) {
                localVarQueryParameter['path'] = path;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get the Git status of the repository at the specified path
         * @summary Get Git status
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStatus: async (path: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'path' is not null or undefined
            assertParamExists('getStatus', 'path', path)
            const localVarPath = `/git/status`;
            // 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;

            if (path !== undefined) {
                localVarQueryParameter['path'] = path;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get a list of all branches in the Git repository
         * @summary List branches
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBranches: async (path: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'path' is not null or undefined
            assertParamExists('listBranches', 'path', path)
            const localVarPath = `/git/branches`;
            // 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;

            if (path !== undefined) {
                localVarQueryParameter['path'] = path;
            }

            localVarHeaderParameter['Accept'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Pull changes from the remote Git repository
         * @summary Pull changes from remote
         * @param {GitRepoRequest} request Pull request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pullChanges: async (request: GitRepoRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('pullChanges', 'request', request)
            const localVarPath = `/git/pull`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Push local changes to the remote Git repository
         * @summary Push changes to remote
         * @param {GitRepoRequest} request Push request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pushChanges: async (request: GitRepoRequest, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'request' is not null or undefined
            assertParamExists('pushChanges', 'request', request)
            const localVarPath = `/git/push`;
            // 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;

            localVarHeaderParameter['Content-Type'] = 'application/json';

            setSearchParams(localVarUrlObj, localVarQueryParameter);
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            localVarRequestOptions.data = serializeDataIfNeeded(request, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * GitApi - functional programming interface
 */
export const GitApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = GitApiAxiosParamCreator(configuration)
    return {
        /**
         * Add files to the Git staging area
         * @summary Add files to Git staging
         * @param {GitAddRequest} request Add files request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async addFiles(request: GitAddRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.addFiles(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.addFiles']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Switch to a different branch or commit in the Git repository
         * @summary Checkout branch or commit
         * @param {GitCheckoutRequest} request Checkout request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async checkoutBranch(request: GitCheckoutRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.checkoutBranch(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.checkoutBranch']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Clone a Git repository to the specified path
         * @summary Clone a Git repository
         * @param {GitCloneRequest} request Clone repository request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async cloneRepository(request: GitCloneRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.cloneRepository(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.cloneRepository']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Commit staged changes to the Git repository
         * @summary Commit changes
         * @param {GitCommitRequest} request Commit request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async commitChanges(request: GitCommitRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GitCommitResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.commitChanges(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.commitChanges']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Create a new branch in the Git repository
         * @summary Create a new branch
         * @param {GitBranchRequest} request Create branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async createBranch(request: GitBranchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createBranch(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.createBranch']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Delete a branch from the Git repository
         * @summary Delete a branch
         * @param {GitDeleteBranchRequest} request Delete branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async deleteBranch(request: GitDeleteBranchRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.deleteBranch(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.deleteBranch']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get the commit history of the Git repository
         * @summary Get commit history
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getCommitHistory(path: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<GitCommitInfo>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getCommitHistory(path, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.getCommitHistory']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get the Git status of the repository at the specified path
         * @summary Get Git status
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getStatus(path: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GitStatus>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getStatus(path, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.getStatus']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Get a list of all branches in the Git repository
         * @summary List branches
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async listBranches(path: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ListBranchResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.listBranches(path, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.listBranches']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Pull changes from the remote Git repository
         * @summary Pull changes from remote
         * @param {GitRepoRequest} request Pull request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async pullChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.pullChanges(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.pullChanges']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Push local changes to the remote Git repository
         * @summary Push changes to remote
         * @param {GitRepoRequest} request Push request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async pushChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.pushChanges(request, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['GitApi.pushChanges']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * GitApi - factory interface
 */
export const GitApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = GitApiFp(configuration)
    return {
        /**
         * Add files to the Git staging area
         * @summary Add files to Git staging
         * @param {GitAddRequest} request Add files request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        addFiles(request: GitAddRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.addFiles(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Switch to a different branch or commit in the Git repository
         * @summary Checkout branch or commit
         * @param {GitCheckoutRequest} request Checkout request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        checkoutBranch(request: GitCheckoutRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.checkoutBranch(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Clone a Git repository to the specified path
         * @summary Clone a Git repository
         * @param {GitCloneRequest} request Clone repository request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        cloneRepository(request: GitCloneRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.cloneRepository(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Commit staged changes to the Git repository
         * @summary Commit changes
         * @param {GitCommitRequest} request Commit request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        commitChanges(request: GitCommitRequest, options?: RawAxiosRequestConfig): AxiosPromise<GitCommitResponse> {
            return localVarFp.commitChanges(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Create a new branch in the Git repository
         * @summary Create a new branch
         * @param {GitBranchRequest} request Create branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        createBranch(request: GitBranchRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.createBranch(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete a branch from the Git repository
         * @summary Delete a branch
         * @param {GitDeleteBranchRequest} request Delete branch request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        deleteBranch(request: GitDeleteBranchRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.deleteBranch(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Get the commit history of the Git repository
         * @summary Get commit history
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getCommitHistory(path: string, options?: RawAxiosRequestConfig): AxiosPromise<Array<GitCommitInfo>> {
            return localVarFp.getCommitHistory(path, options).then((request) => request(axios, basePath));
        },
        /**
         * Get the Git status of the repository at the specified path
         * @summary Get Git status
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getStatus(path: string, options?: RawAxiosRequestConfig): AxiosPromise<GitStatus> {
            return localVarFp.getStatus(path, options).then((request) => request(axios, basePath));
        },
        /**
         * Get a list of all branches in the Git repository
         * @summary List branches
         * @param {string} path Repository path
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        listBranches(path: string, options?: RawAxiosRequestConfig): AxiosPromise<ListBranchResponse> {
            return localVarFp.listBranches(path, options).then((request) => request(axios, basePath));
        },
        /**
         * Pull changes from the remote Git repository
         * @summary Pull changes from remote
         * @param {GitRepoRequest} request Pull request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pullChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.pullChanges(request, options).then((request) => request(axios, basePath));
        },
        /**
         * Push local changes to the remote Git repository
         * @summary Push changes to remote
         * @param {GitRepoRequest} request Push request
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        pushChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig): AxiosPromise<void> {
            return localVarFp.pushChanges(request, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * GitApi - object-oriented interface
 */
export class GitApi extends BaseAPI {
    /**
     * Add files to the Git staging area
     * @summary Add files to Git staging
     * @param {GitAddRequest} request Add files request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public addFiles(request: GitAddRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).addFiles(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Switch to a different branch or commit in the Git repository
     * @summary Checkout branch or commit
     * @param {GitCheckoutRequest} request Checkout request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public checkoutBranch(request: GitCheckoutRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).checkoutBranch(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Clone a Git repository to the specified path
     * @summary Clone a Git repository
     * @param {GitCloneRequest} request Clone repository request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public cloneRepository(request: GitCloneRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).cloneRepository(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Commit staged changes to the Git repository
     * @summary Commit changes
     * @param {GitCommitRequest} request Commit request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public commitChanges(request: GitCommitRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).commitChanges(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Create a new branch in the Git repository
     * @summary Create a new branch
     * @param {GitBranchRequest} request Create branch request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public createBranch(request: GitBranchRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).createBranch(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Delete a branch from the Git repository
     * @summary Delete a branch
     * @param {GitDeleteBranchRequest} request Delete branch request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public deleteBranch(request: GitDeleteBranchRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).deleteBranch(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get the commit history of the Git repository
     * @summary Get commit history
     * @param {string} path Repository path
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getCommitHistory(path: string, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).getCommitHistory(path, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get the Git status of the repository at the specified path
     * @summary Get Git status
     * @param {string} path Repository path
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public getStatus(path: string, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).getStatus(path, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get a list of all branches in the Git repository
     * @summary List branches
     * @param {string} path Repository path
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public listBranches(path: string, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).listBranches(path, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Pull changes from the remote Git repository
     * @summary Pull changes from remote
     * @param {GitRepoRequest} request Pull request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public pullChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).pullChanges(request, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Push local changes to the remote Git repository
     * @summary Push changes to remote
     * @param {GitRepoRequest} request Push request
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    public pushChanges(request: GitRepoRequest, options?: RawAxiosRequestConfig) {
        return GitApiFp(this.configuration).pushChanges(request, options).then((request) => request(this.axios, this.basePath));
    }
}

