/* tslint:disable */
/* eslint-disable */
/**
 * Admin.NET
 * 让 .NET 开发更简单、更通用、更流行。前后端分离架构(.NET6/Vue3)，开箱即用紧随前沿技术。<br/><a href='https://gitee.com/zuohuaijun/Admin.NET/'>https://gitee.com/zuohuaijun/Admin.NET</a>
 *
 * OpenAPI spec version: 1.0.0
 * Contact: 515096995@qq.com
 *
 * 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, { AxiosResponse, AxiosInstance, AxiosRequestConfig } 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 { AdminResultObject } from '../models';
import { AdminResultWeChatPay } from '../models';
import { AdminResultWeChatPayOutput } from '../models';
import { WeChatPayParaInput } from '../models';
import { WeChatPayTransactionInput } from '../models';
/**
 * WeChatPayApi - axios parameter creator
 * @export
 */
export const WeChatPayApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary 微信支付成功回调(商户直连)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        notifyWeChatPayPayCallBackPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/notify/weChatPay/payCallBack`;
            // 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 :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[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,
            };
        },
        /**
         * 
         * @summary 微信支付成功回调(服务商模式)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        notifyWeChatPayPayPartnerCallbackPost: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/notify/weChatPay/payPartnerCallback`;
            // 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 :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[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,
            };
        },
        /**
         * 
         * @summary 生成JSAPI调起支付所需参数
         * @param {WeChatPayParaInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        weChatPayGenPayParaPost: async (body?: WeChatPayParaInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/weChatPay/genPayPara`;
            // 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 :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

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

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data =  needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary 获取支付订单详情
         * @param {string} [tradeId] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        weChatPayPayInfoGet: async (tradeId?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/weChatPay/payInfo`;
            // 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 :AxiosRequestConfig = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

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

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[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,
            };
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(服务商模式)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        weChatPayPayPartnerTransactionPost: async (body?: WeChatPayTransactionInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/weChatPay/payPartnerTransaction`;
            // 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 :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

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

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data =  needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

            return {
                url: localVarUrlObj.pathname + localVarUrlObj.search + localVarUrlObj.hash,
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(商户直连)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        weChatPayPayTransactionPost: async (body?: WeChatPayTransactionInput, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/weChatPay/payTransaction`;
            // 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 :AxiosRequestConfig = { method: 'POST', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication Bearer required

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

            const query = new URLSearchParams(localVarUrlObj.search);
            for (const key in localVarQueryParameter) {
                query.set(key, localVarQueryParameter[key]);
            }
            for (const key in options.params) {
                query.set(key, options.params[key]);
            }
            localVarUrlObj.search = (new URLSearchParams(query)).toString();
            let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
            localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
            const needsSerialization = (typeof body !== "string") || localVarRequestOptions.headers['Content-Type'] === 'application/json';
            localVarRequestOptions.data =  needsSerialization ? JSON.stringify(body !== undefined ? body : {}) : (body || "");

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

/**
 * WeChatPayApi - functional programming interface
 * @export
 */
export const WeChatPayApiFp = function(configuration?: Configuration) {
    return {
        /**
         * 
         * @summary 微信支付成功回调(商户直连)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async notifyWeChatPayPayCallBackPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWeChatPayOutput>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).notifyWeChatPayPayCallBackPost(options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * 
         * @summary 微信支付成功回调(服务商模式)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async notifyWeChatPayPayPartnerCallbackPost(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<void>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).notifyWeChatPayPayPartnerCallbackPost(options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * 
         * @summary 生成JSAPI调起支付所需参数
         * @param {WeChatPayParaInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayGenPayParaPost(body?: WeChatPayParaInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).weChatPayGenPayParaPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * 
         * @summary 获取支付订单详情
         * @param {string} [tradeId] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayInfoGet(tradeId?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultWeChatPay>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).weChatPayPayInfoGet(tradeId, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(服务商模式)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayPartnerTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).weChatPayPayPartnerTransactionPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(商户直连)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => Promise<AxiosResponse<AdminResultObject>>> {
            const localVarAxiosArgs = await WeChatPayApiAxiosParamCreator(configuration).weChatPayPayTransactionPost(body, options);
            return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
                const axiosRequestArgs :AxiosRequestConfig = {...localVarAxiosArgs.options, url: basePath + localVarAxiosArgs.url};
                return axios.request(axiosRequestArgs);
            };
        },
    }
};

/**
 * WeChatPayApi - factory interface
 * @export
 */
export const WeChatPayApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    return {
        /**
         * 
         * @summary 微信支付成功回调(商户直连)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async notifyWeChatPayPayCallBackPost(options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWeChatPayOutput>> {
            return WeChatPayApiFp(configuration).notifyWeChatPayPayCallBackPost(options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary 微信支付成功回调(服务商模式)
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async notifyWeChatPayPayPartnerCallbackPost(options?: AxiosRequestConfig): Promise<AxiosResponse<void>> {
            return WeChatPayApiFp(configuration).notifyWeChatPayPayPartnerCallbackPost(options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary 生成JSAPI调起支付所需参数
         * @param {WeChatPayParaInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayGenPayParaPost(body?: WeChatPayParaInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
            return WeChatPayApiFp(configuration).weChatPayGenPayParaPost(body, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary 获取支付订单详情
         * @param {string} [tradeId] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayInfoGet(tradeId?: string, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultWeChatPay>> {
            return WeChatPayApiFp(configuration).weChatPayPayInfoGet(tradeId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(服务商模式)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayPartnerTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
            return WeChatPayApiFp(configuration).weChatPayPayPartnerTransactionPost(body, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary 微信支付统一下单获取Id(商户直连)
         * @param {WeChatPayTransactionInput} [body] 
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async weChatPayPayTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig): Promise<AxiosResponse<AdminResultObject>> {
            return WeChatPayApiFp(configuration).weChatPayPayTransactionPost(body, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * WeChatPayApi - object-oriented interface
 * @export
 * @class WeChatPayApi
 * @extends {BaseAPI}
 */
export class WeChatPayApi extends BaseAPI {
    /**
     * 
     * @summary 微信支付成功回调(商户直连)
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async notifyWeChatPayPayCallBackPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWeChatPayOutput>> {
        return WeChatPayApiFp(this.configuration).notifyWeChatPayPayCallBackPost(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * 
     * @summary 微信支付成功回调(服务商模式)
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async notifyWeChatPayPayPartnerCallbackPost(options?: AxiosRequestConfig) : Promise<AxiosResponse<void>> {
        return WeChatPayApiFp(this.configuration).notifyWeChatPayPayPartnerCallbackPost(options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * 
     * @summary 生成JSAPI调起支付所需参数
     * @param {WeChatPayParaInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async weChatPayGenPayParaPost(body?: WeChatPayParaInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
        return WeChatPayApiFp(this.configuration).weChatPayGenPayParaPost(body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * 
     * @summary 获取支付订单详情
     * @param {string} [tradeId] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async weChatPayPayInfoGet(tradeId?: string, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultWeChatPay>> {
        return WeChatPayApiFp(this.configuration).weChatPayPayInfoGet(tradeId, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * 
     * @summary 微信支付统一下单获取Id(服务商模式)
     * @param {WeChatPayTransactionInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async weChatPayPayPartnerTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
        return WeChatPayApiFp(this.configuration).weChatPayPayPartnerTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
    }
    /**
     * 
     * @summary 微信支付统一下单获取Id(商户直连)
     * @param {WeChatPayTransactionInput} [body] 
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof WeChatPayApi
     */
    public async weChatPayPayTransactionPost(body?: WeChatPayTransactionInput, options?: AxiosRequestConfig) : Promise<AxiosResponse<AdminResultObject>> {
        return WeChatPayApiFp(this.configuration).weChatPayPayTransactionPost(body, options).then((request) => request(this.axios, this.basePath));
    }
}
