/* tslint:disable */
/* eslint-disable */
/**
 * Cardano Wallet Backend API
 * <p align=\"right\"><img style=\"position: relative; top: -10em; margin-bottom: -12em;\" width=\"20%\" src=\"https://cardanodocs.com/img/cardano.png\"></img></p> 
 *
 * OpenAPI spec version: 2021.3.4
 * 
 *
 * NOTE: This class is auto generated by the swagger code generator program.
 * https://github.com/swagger-api/swagger-codegen.git
 * Do not edit the class manually.
 */
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
import { ApiNetworkInformation } from '../models';
import { ApiNetworkClock } from '../models';
import { ApiNetworkParameters } from '../models';
import { NotAcceptable } from '../models';
/**
 * NetworkApi - axios parameter creator
 * @export
 */
export const NetworkApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Clock
         * @param {boolean} [forceNtpCheck] NTP checks are cached for short duration to avoid sending too many queries to the central NTP servers. In some cases however, a client may want to force a new check.  When this flag is set, the request **will block** until NTP server responds or will timeout after a while without any answer from the NTP server. 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkClock: async (forceNtpCheck?: boolean, options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/network/clock`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

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

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.query) {
                query.set(key, options.query[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Information
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkInformation: async (options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/network/information`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.query) {
                query.set(key, options.query[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p>  Returns the set of network parameters for the current epoch. 
         * @summary Parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkParameters: async (options: any = {}): Promise<RequestArgs> => {
            const localVarPath = `/network/parameters`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, 'https://example.com');
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }
            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.query) {
                query.set(key, options.query[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
    }
};

/**
 * NetworkApi - functional programming interface
 * @export
 */
export const NetworkApiFp = function(configuration?: Configuration) {
    return {
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Clock
         * @param {boolean} [forceNtpCheck] NTP checks are cached for short duration to avoid sending too many queries to the central NTP servers. In some cases however, a client may want to force a new check.  When this flag is set, the request **will block** until NTP server responds or will timeout after a while without any answer from the NTP server. 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getNetworkClock(forceNtpCheck?: boolean, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiNetworkClock>> {
            const localVarAxiosArgs = await NetworkApiAxiosParamCreator(configuration).getNetworkClock(forceNtpCheck, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Information
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getNetworkInformation(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiNetworkInformation>> {
            const localVarAxiosArgs = await NetworkApiAxiosParamCreator(configuration).getNetworkInformation(options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p>  Returns the set of network parameters for the current epoch. 
         * @summary Parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async getNetworkParameters(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<ApiNetworkParameters>> {
            const localVarAxiosArgs = await NetworkApiAxiosParamCreator(configuration).getNetworkParameters(options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
    }
};

/**
 * NetworkApi - factory interface
 * @export
 */
export const NetworkApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    return {
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Clock
         * @param {boolean} [forceNtpCheck] NTP checks are cached for short duration to avoid sending too many queries to the central NTP servers. In some cases however, a client may want to force a new check.  When this flag is set, the request **will block** until NTP server responds or will timeout after a while without any answer from the NTP server. 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkClock(forceNtpCheck?: boolean, options?: any): AxiosPromise<ApiNetworkClock> {
            return NetworkApiFp(configuration).getNetworkClock(forceNtpCheck, options).then((request) => request(axios, basePath));
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p> 
         * @summary Information
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkInformation(options?: any): AxiosPromise<ApiNetworkInformation> {
            return NetworkApiFp(configuration).getNetworkInformation(options).then((request) => request(axios, basePath));
        },
        /**
         * <p align=\"right\">status: <strong>stable</strong></p>  Returns the set of network parameters for the current epoch. 
         * @summary Parameters
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        getNetworkParameters(options?: any): AxiosPromise<ApiNetworkParameters> {
            return NetworkApiFp(configuration).getNetworkParameters(options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * NetworkApi - object-oriented interface
 * @export
 * @class NetworkApi
 * @extends {BaseAPI}
 */
export class NetworkApi extends BaseAPI {
    /**
     * <p align=\"right\">status: <strong>stable</strong></p> 
     * @summary Clock
     * @param {boolean} [forceNtpCheck] NTP checks are cached for short duration to avoid sending too many queries to the central NTP servers. In some cases however, a client may want to force a new check.  When this flag is set, the request **will block** until NTP server responds or will timeout after a while without any answer from the NTP server. 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NetworkApi
     */
    public getNetworkClock(forceNtpCheck?: boolean, options?: any) {
        return NetworkApiFp(this.configuration).getNetworkClock(forceNtpCheck, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * <p align=\"right\">status: <strong>stable</strong></p> 
     * @summary Information
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NetworkApi
     */
    public getNetworkInformation(options?: any) {
        return NetworkApiFp(this.configuration).getNetworkInformation(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * <p align=\"right\">status: <strong>stable</strong></p>  Returns the set of network parameters for the current epoch. 
     * @summary Parameters
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof NetworkApi
     */
    public getNetworkParameters(options?: any) {
        return NetworkApiFp(this.configuration).getNetworkParameters(options).then((request) => request(this.axios, this.basePath));
    }
}
