/* 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.11-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';
/**
 * ThumbnailV1alpha1PublicApi - axios parameter creator
 * @export
 */
export const ThumbnailV1alpha1PublicApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Get thumbnail by URI
         * @param {string} uri The URI of the image
         * @param {string} size The size of the thumbnail,available values are s,m,l,xl
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getThumbnailByUri: async (uri: string, size: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'uri' is not null or undefined
            assertParamExists('getThumbnailByUri', 'uri', uri)
            // verify required parameter 'size' is not null or undefined
            assertParamExists('getThumbnailByUri', 'size', size)
            const localVarPath = `/apis/api.storage.halo.run/v1alpha1/thumbnails/-/via-uri`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

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

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

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

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

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


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

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

/**
 * ThumbnailV1alpha1PublicApi - functional programming interface
 * @export
 */
export const ThumbnailV1alpha1PublicApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ThumbnailV1alpha1PublicApiAxiosParamCreator(configuration)
    return {
        /**
         * Get thumbnail by URI
         * @param {string} uri The URI of the image
         * @param {string} size The size of the thumbnail,available values are s,m,l,xl
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getThumbnailByUri(uri: string, size: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getThumbnailByUri(uri, size, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ThumbnailV1alpha1PublicApi.getThumbnailByUri']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ThumbnailV1alpha1PublicApi - factory interface
 * @export
 */
export const ThumbnailV1alpha1PublicApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ThumbnailV1alpha1PublicApiFp(configuration)
    return {
        /**
         * Get thumbnail by URI
         * @param {ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest} requestParameters Request parameters.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getThumbnailByUri(requestParameters: ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest, options?: RawAxiosRequestConfig): AxiosPromise<File> {
            return localVarFp.getThumbnailByUri(requestParameters.uri, requestParameters.size, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * Request parameters for getThumbnailByUri operation in ThumbnailV1alpha1PublicApi.
 * @export
 * @interface ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest
 */
export interface ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest {
    /**
     * The URI of the image
     * @type {string}
     * @memberof ThumbnailV1alpha1PublicApiGetThumbnailByUri
     */
    readonly uri: string

    /**
     * The size of the thumbnail,available values are s,m,l,xl
     * @type {string}
     * @memberof ThumbnailV1alpha1PublicApiGetThumbnailByUri
     */
    readonly size: string
}

/**
 * ThumbnailV1alpha1PublicApi - object-oriented interface
 * @export
 * @class ThumbnailV1alpha1PublicApi
 * @extends {BaseAPI}
 */
export class ThumbnailV1alpha1PublicApi extends BaseAPI {
    /**
     * Get thumbnail by URI
     * @param {ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ThumbnailV1alpha1PublicApi
     */
    public getThumbnailByUri(requestParameters: ThumbnailV1alpha1PublicApiGetThumbnailByUriRequest, options?: RawAxiosRequestConfig) {
        return ThumbnailV1alpha1PublicApiFp(this.configuration).getThumbnailByUri(requestParameters.uri, requestParameters.size, options).then((request) => request(this.axios, this.basePath));
    }
}

