/* tslint:disable */
/* eslint-disable */
/**
 * Halo
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 2.20.10-SNAPSHOT
 * 
 *
 * 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 } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { UserConnection } from '../models';
/**
 * UserConnectionV1alpha1UcApi - axios parameter creator
 * @export
 */
export const UserConnectionV1alpha1UcApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Disconnect my connection from a third-party platform.
         * @param {string} registerId The registration ID of the third-party platform.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        disconnectMyConnection: async (registerId: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'registerId' is not null or undefined
            assertParamExists('disconnectMyConnection', 'registerId', registerId)
            const localVarPath = `/apis/uc.api.auth.halo.run/v1alpha1/user-connections/{registerId}/disconnect`
                .replace(`{${"registerId"}}`, encodeURIComponent(String(registerId)));
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication basicAuth required
            // http basic authentication required
            setBasicAuthToObject(localVarRequestOptions, configuration)

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)


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

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

/**
 * UserConnectionV1alpha1UcApi - functional programming interface
 * @export
 */
export const UserConnectionV1alpha1UcApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = UserConnectionV1alpha1UcApiAxiosParamCreator(configuration)
    return {
        /**
         * Disconnect my connection from a third-party platform.
         * @param {string} registerId The registration ID of the third-party platform.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async disconnectMyConnection(registerId: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Array<UserConnection>>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.disconnectMyConnection(registerId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['UserConnectionV1alpha1UcApi.disconnectMyConnection']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * UserConnectionV1alpha1UcApi - factory interface
 * @export
 */
export const UserConnectionV1alpha1UcApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = UserConnectionV1alpha1UcApiFp(configuration)
    return {
        /**
         * Disconnect my connection from a third-party platform.
         * @param {UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        disconnectMyConnection(requestParameters: UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest, options?: RawAxiosRequestConfig): AxiosPromise<Array<UserConnection>> {
            return localVarFp.disconnectMyConnection(requestParameters.registerId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for disconnectMyConnection operation in UserConnectionV1alpha1UcApi.
 * @export
 * @interface UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest
 */
export interface UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest {
    /**
     * The registration ID of the third-party platform.
     * @type {string}
     * @memberof UserConnectionV1alpha1UcApiDisconnectMyConnection
     */
    readonly registerId: string
}

/**
 * UserConnectionV1alpha1UcApi - object-oriented interface
 * @export
 * @class UserConnectionV1alpha1UcApi
 * @extends {BaseAPI}
 */
export class UserConnectionV1alpha1UcApi extends BaseAPI {
    /**
     * Disconnect my connection from a third-party platform.
     * @param {UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof UserConnectionV1alpha1UcApi
     */
    public disconnectMyConnection(requestParameters: UserConnectionV1alpha1UcApiDisconnectMyConnectionRequest, options?: RawAxiosRequestConfig) {
        return UserConnectionV1alpha1UcApiFp(this.configuration).disconnectMyConnection(requestParameters.registerId, options).then((request) => request(this.axios, this.basePath));
    }
}

