/* tslint:disable */
/* eslint-disable */
/**
 *
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document:
 *
 *
 * 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,
  type RequestArgs,
  BaseAPI,
  RequiredError,
  operationServerMap
} from '../base';
// @ts-ignore
import type { KamiApiCamelOilV1AccountOrderListRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1ListOrderRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1OrderCallbackReq } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1OrderCallbackRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1OrderDetailRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1OrderHistoryRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1SubmitOrderReq } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1SubmitOrderRes } from '../models';
/**
 * JDV2OrderApi - axios parameter creator
 */
export const JDV2OrderApiAxiosParamCreator = function (
  configuration?: Configuration
) {
  return {
    /**
     *
     * @summary 账号历史订单
     * @param {number} current 页数
     * @param {ApiJdV2OrderAccountOrdersGetPageSizeEnum} pageSize 页码
     * @param {number} accountId 账号ID
     * @param {ApiJdV2OrderAccountOrdersGetStatusEnum} [status] 订单状态筛选
     * @param {ApiJdV2OrderAccountOrdersGetPayStatusEnum} [payStatus] 支付状态筛选
     * @param {Array<string>} [dateRange] 时间范围
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderAccountOrdersGet: async (
      current: number,
      pageSize: ApiJdV2OrderAccountOrdersGetPageSizeEnum,
      accountId: number,
      status?: ApiJdV2OrderAccountOrdersGetStatusEnum,
      payStatus?: ApiJdV2OrderAccountOrdersGetPayStatusEnum,
      dateRange?: Array<string>,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'current' is not null or undefined
      assertParamExists('apiJdV2OrderAccountOrdersGet', 'current', current);
      // verify required parameter 'pageSize' is not null or undefined
      assertParamExists('apiJdV2OrderAccountOrdersGet', 'pageSize', pageSize);
      // verify required parameter 'accountId' is not null or undefined
      assertParamExists('apiJdV2OrderAccountOrdersGet', 'accountId', accountId);
      const localVarPath = `/api/jd-v2/order/accountOrders`;
      // 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 (current !== undefined) {
        localVarQueryParameter['current'] = current;
      }

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

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

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

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

      if (dateRange) {
        localVarQueryParameter['dateRange'] = dateRange;
      }

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 手动回调
     * @param {KamiApiCamelOilV1OrderCallbackReq} [kamiApiCamelOilV1OrderCallbackReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderCallbackPost: async (
      kamiApiCamelOilV1OrderCallbackReq?: KamiApiCamelOilV1OrderCallbackReq,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/api/jd-v2/order/callback`;
      // 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(
        kamiApiCamelOilV1OrderCallbackReq,
        localVarRequestOptions,
        configuration
      );

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 订单详情
     * @param {string} orderNo 订单号
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderDetailGet: async (
      orderNo: string,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'orderNo' is not null or undefined
      assertParamExists('apiJdV2OrderDetailGet', 'orderNo', orderNo);
      const localVarPath = `/api/jd-v2/order/detail`;
      // 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 (orderNo !== undefined) {
        localVarQueryParameter['orderNo'] = orderNo;
      }

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 订单历史记录
     * @param {number} current 页数
     * @param {ApiJdV2OrderHistoryGetPageSizeEnum} pageSize 页码
     * @param {string} orderNo 订单号
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderHistoryGet: async (
      current: number,
      pageSize: ApiJdV2OrderHistoryGetPageSizeEnum,
      orderNo: string,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'current' is not null or undefined
      assertParamExists('apiJdV2OrderHistoryGet', 'current', current);
      // verify required parameter 'pageSize' is not null or undefined
      assertParamExists('apiJdV2OrderHistoryGet', 'pageSize', pageSize);
      // verify required parameter 'orderNo' is not null or undefined
      assertParamExists('apiJdV2OrderHistoryGet', 'orderNo', orderNo);
      const localVarPath = `/api/jd-v2/order/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 (current !== undefined) {
        localVarQueryParameter['current'] = current;
      }

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

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

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 订单列表
     * @param {number} current 页数
     * @param {ApiJdV2OrderListGetPageSizeEnum} pageSize 页码
     * @param {string} [merchantOrderId] 商户订单号
     * @param {string} [orderNo] 系统订单号
     * @param {number} [accountId] 账号ID
     * @param {ApiJdV2OrderListGetStatusEnum} [status] 订单状态
     * @param {ApiJdV2OrderListGetPayStatusEnum} [payStatus] 支付状态
     * @param {Array<string>} [dateRange] 时间范围
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderListGet: async (
      current: number,
      pageSize: ApiJdV2OrderListGetPageSizeEnum,
      merchantOrderId?: string,
      orderNo?: string,
      accountId?: number,
      status?: ApiJdV2OrderListGetStatusEnum,
      payStatus?: ApiJdV2OrderListGetPayStatusEnum,
      dateRange?: Array<string>,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'current' is not null or undefined
      assertParamExists('apiJdV2OrderListGet', 'current', current);
      // verify required parameter 'pageSize' is not null or undefined
      assertParamExists('apiJdV2OrderListGet', 'pageSize', pageSize);
      const localVarPath = `/api/jd-v2/order/list`;
      // 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 (current !== undefined) {
        localVarQueryParameter['current'] = current;
      }

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

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

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

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

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

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

      if (dateRange) {
        localVarQueryParameter['dateRange'] = dateRange;
      }

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 提交订单
     * @param {KamiApiCamelOilV1SubmitOrderReq} [kamiApiCamelOilV1SubmitOrderReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderSubmitPost: async (
      kamiApiCamelOilV1SubmitOrderReq?: KamiApiCamelOilV1SubmitOrderReq,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/api/jd-v2/order/submit`;
      // 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(
        kamiApiCamelOilV1SubmitOrderReq,
        localVarRequestOptions,
        configuration
      );

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

/**
 * JDV2OrderApi - functional programming interface
 */
export const JDV2OrderApiFp = function (configuration?: Configuration) {
  const localVarAxiosParamCreator =
    JDV2OrderApiAxiosParamCreator(configuration);
  return {
    /**
     *
     * @summary 账号历史订单
     * @param {number} current 页数
     * @param {ApiJdV2OrderAccountOrdersGetPageSizeEnum} pageSize 页码
     * @param {number} accountId 账号ID
     * @param {ApiJdV2OrderAccountOrdersGetStatusEnum} [status] 订单状态筛选
     * @param {ApiJdV2OrderAccountOrdersGetPayStatusEnum} [payStatus] 支付状态筛选
     * @param {Array<string>} [dateRange] 时间范围
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderAccountOrdersGet(
      current: number,
      pageSize: ApiJdV2OrderAccountOrdersGetPageSizeEnum,
      accountId: number,
      status?: ApiJdV2OrderAccountOrdersGetStatusEnum,
      payStatus?: ApiJdV2OrderAccountOrdersGetPayStatusEnum,
      dateRange?: Array<string>,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1AccountOrderListRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderAccountOrdersGet(
          current,
          pageSize,
          accountId,
          status,
          payStatus,
          dateRange,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderAccountOrdersGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 手动回调
     * @param {KamiApiCamelOilV1OrderCallbackReq} [kamiApiCamelOilV1OrderCallbackReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderCallbackPost(
      kamiApiCamelOilV1OrderCallbackReq?: KamiApiCamelOilV1OrderCallbackReq,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1OrderCallbackRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderCallbackPost(
          kamiApiCamelOilV1OrderCallbackReq,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderCallbackPost']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 订单详情
     * @param {string} orderNo 订单号
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderDetailGet(
      orderNo: string,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1OrderDetailRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderDetailGet(orderNo, options);
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderDetailGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 订单历史记录
     * @param {number} current 页数
     * @param {ApiJdV2OrderHistoryGetPageSizeEnum} pageSize 页码
     * @param {string} orderNo 订单号
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderHistoryGet(
      current: number,
      pageSize: ApiJdV2OrderHistoryGetPageSizeEnum,
      orderNo: string,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1OrderHistoryRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderHistoryGet(
          current,
          pageSize,
          orderNo,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderHistoryGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 订单列表
     * @param {number} current 页数
     * @param {ApiJdV2OrderListGetPageSizeEnum} pageSize 页码
     * @param {string} [merchantOrderId] 商户订单号
     * @param {string} [orderNo] 系统订单号
     * @param {number} [accountId] 账号ID
     * @param {ApiJdV2OrderListGetStatusEnum} [status] 订单状态
     * @param {ApiJdV2OrderListGetPayStatusEnum} [payStatus] 支付状态
     * @param {Array<string>} [dateRange] 时间范围
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderListGet(
      current: number,
      pageSize: ApiJdV2OrderListGetPageSizeEnum,
      merchantOrderId?: string,
      orderNo?: string,
      accountId?: number,
      status?: ApiJdV2OrderListGetStatusEnum,
      payStatus?: ApiJdV2OrderListGetPayStatusEnum,
      dateRange?: Array<string>,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1ListOrderRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderListGet(
          current,
          pageSize,
          merchantOrderId,
          orderNo,
          accountId,
          status,
          payStatus,
          dateRange,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderListGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 提交订单
     * @param {KamiApiCamelOilV1SubmitOrderReq} [kamiApiCamelOilV1SubmitOrderReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2OrderSubmitPost(
      kamiApiCamelOilV1SubmitOrderReq?: KamiApiCamelOilV1SubmitOrderReq,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1SubmitOrderRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2OrderSubmitPost(
          kamiApiCamelOilV1SubmitOrderReq,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2OrderApi.apiJdV2OrderSubmitPost']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    }
  };
};

/**
 * JDV2OrderApi - factory interface
 */
export const JDV2OrderApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = JDV2OrderApiFp(configuration);
  return {
    /**
     *
     * @summary 账号历史订单
     * @param {JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderAccountOrdersGet(
      requestParameters: JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1AccountOrderListRes> {
      return localVarFp
        .apiJdV2OrderAccountOrdersGet(
          requestParameters.current,
          requestParameters.pageSize,
          requestParameters.accountId,
          requestParameters.status,
          requestParameters.payStatus,
          requestParameters.dateRange,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 手动回调
     * @param {JDV2OrderApiApiJdV2OrderCallbackPostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderCallbackPost(
      requestParameters: JDV2OrderApiApiJdV2OrderCallbackPostRequest = {},
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1OrderCallbackRes> {
      return localVarFp
        .apiJdV2OrderCallbackPost(
          requestParameters.kamiApiCamelOilV1OrderCallbackReq,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 订单详情
     * @param {JDV2OrderApiApiJdV2OrderDetailGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderDetailGet(
      requestParameters: JDV2OrderApiApiJdV2OrderDetailGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1OrderDetailRes> {
      return localVarFp
        .apiJdV2OrderDetailGet(requestParameters.orderNo, options)
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 订单历史记录
     * @param {JDV2OrderApiApiJdV2OrderHistoryGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderHistoryGet(
      requestParameters: JDV2OrderApiApiJdV2OrderHistoryGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1OrderHistoryRes> {
      return localVarFp
        .apiJdV2OrderHistoryGet(
          requestParameters.current,
          requestParameters.pageSize,
          requestParameters.orderNo,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 订单列表
     * @param {JDV2OrderApiApiJdV2OrderListGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderListGet(
      requestParameters: JDV2OrderApiApiJdV2OrderListGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1ListOrderRes> {
      return localVarFp
        .apiJdV2OrderListGet(
          requestParameters.current,
          requestParameters.pageSize,
          requestParameters.merchantOrderId,
          requestParameters.orderNo,
          requestParameters.accountId,
          requestParameters.status,
          requestParameters.payStatus,
          requestParameters.dateRange,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 提交订单
     * @param {JDV2OrderApiApiJdV2OrderSubmitPostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2OrderSubmitPost(
      requestParameters: JDV2OrderApiApiJdV2OrderSubmitPostRequest = {},
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1SubmitOrderRes> {
      return localVarFp
        .apiJdV2OrderSubmitPost(
          requestParameters.kamiApiCamelOilV1SubmitOrderReq,
          options
        )
        .then(request => request(axios, basePath));
    }
  };
};

/**
 * JDV2OrderApi - interface
 */
export interface JDV2OrderApiInterface {
  /**
   *
   * @summary 账号历史订单
   * @param {JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderAccountOrdersGet(
    requestParameters: JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1AccountOrderListRes>;

  /**
   *
   * @summary 手动回调
   * @param {JDV2OrderApiApiJdV2OrderCallbackPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderCallbackPost(
    requestParameters?: JDV2OrderApiApiJdV2OrderCallbackPostRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1OrderCallbackRes>;

  /**
   *
   * @summary 订单详情
   * @param {JDV2OrderApiApiJdV2OrderDetailGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderDetailGet(
    requestParameters: JDV2OrderApiApiJdV2OrderDetailGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1OrderDetailRes>;

  /**
   *
   * @summary 订单历史记录
   * @param {JDV2OrderApiApiJdV2OrderHistoryGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderHistoryGet(
    requestParameters: JDV2OrderApiApiJdV2OrderHistoryGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1OrderHistoryRes>;

  /**
   *
   * @summary 订单列表
   * @param {JDV2OrderApiApiJdV2OrderListGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderListGet(
    requestParameters: JDV2OrderApiApiJdV2OrderListGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1ListOrderRes>;

  /**
   *
   * @summary 提交订单
   * @param {JDV2OrderApiApiJdV2OrderSubmitPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2OrderSubmitPost(
    requestParameters?: JDV2OrderApiApiJdV2OrderSubmitPostRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1SubmitOrderRes>;
}

/**
 * Request parameters for apiJdV2OrderAccountOrdersGet operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest {
  /**
   * 页数
   */
  readonly current: number;

  /**
   * 页码
   */
  readonly pageSize: ApiJdV2OrderAccountOrdersGetPageSizeEnum;

  /**
   * 账号ID
   */
  readonly accountId: number;

  /**
   * 订单状态筛选
   */
  readonly status?: ApiJdV2OrderAccountOrdersGetStatusEnum;

  /**
   * 支付状态筛选
   */
  readonly payStatus?: ApiJdV2OrderAccountOrdersGetPayStatusEnum;

  /**
   * 时间范围
   */
  readonly dateRange?: Array<string>;
}

/**
 * Request parameters for apiJdV2OrderCallbackPost operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderCallbackPostRequest {
  readonly kamiApiCamelOilV1OrderCallbackReq?: KamiApiCamelOilV1OrderCallbackReq;
}

/**
 * Request parameters for apiJdV2OrderDetailGet operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderDetailGetRequest {
  /**
   * 订单号
   */
  readonly orderNo: string;
}

/**
 * Request parameters for apiJdV2OrderHistoryGet operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderHistoryGetRequest {
  /**
   * 页数
   */
  readonly current: number;

  /**
   * 页码
   */
  readonly pageSize: ApiJdV2OrderHistoryGetPageSizeEnum;

  /**
   * 订单号
   */
  readonly orderNo: string;
}

/**
 * Request parameters for apiJdV2OrderListGet operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderListGetRequest {
  /**
   * 页数
   */
  readonly current: number;

  /**
   * 页码
   */
  readonly pageSize: ApiJdV2OrderListGetPageSizeEnum;

  /**
   * 商户订单号
   */
  readonly merchantOrderId?: string;

  /**
   * 系统订单号
   */
  readonly orderNo?: string;

  /**
   * 账号ID
   */
  readonly accountId?: number;

  /**
   * 订单状态
   */
  readonly status?: ApiJdV2OrderListGetStatusEnum;

  /**
   * 支付状态
   */
  readonly payStatus?: ApiJdV2OrderListGetPayStatusEnum;

  /**
   * 时间范围
   */
  readonly dateRange?: Array<string>;
}

/**
 * Request parameters for apiJdV2OrderSubmitPost operation in JDV2OrderApi.
 */
export interface JDV2OrderApiApiJdV2OrderSubmitPostRequest {
  readonly kamiApiCamelOilV1SubmitOrderReq?: KamiApiCamelOilV1SubmitOrderReq;
}

/**
 * JDV2OrderApi - object-oriented interface
 */
export class JDV2OrderApi extends BaseAPI implements JDV2OrderApiInterface {
  /**
   *
   * @summary 账号历史订单
   * @param {JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderAccountOrdersGet(
    requestParameters: JDV2OrderApiApiJdV2OrderAccountOrdersGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderAccountOrdersGet(
        requestParameters.current,
        requestParameters.pageSize,
        requestParameters.accountId,
        requestParameters.status,
        requestParameters.payStatus,
        requestParameters.dateRange,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 手动回调
   * @param {JDV2OrderApiApiJdV2OrderCallbackPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderCallbackPost(
    requestParameters: JDV2OrderApiApiJdV2OrderCallbackPostRequest = {},
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderCallbackPost(
        requestParameters.kamiApiCamelOilV1OrderCallbackReq,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 订单详情
   * @param {JDV2OrderApiApiJdV2OrderDetailGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderDetailGet(
    requestParameters: JDV2OrderApiApiJdV2OrderDetailGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderDetailGet(requestParameters.orderNo, options)
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 订单历史记录
   * @param {JDV2OrderApiApiJdV2OrderHistoryGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderHistoryGet(
    requestParameters: JDV2OrderApiApiJdV2OrderHistoryGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderHistoryGet(
        requestParameters.current,
        requestParameters.pageSize,
        requestParameters.orderNo,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 订单列表
   * @param {JDV2OrderApiApiJdV2OrderListGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderListGet(
    requestParameters: JDV2OrderApiApiJdV2OrderListGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderListGet(
        requestParameters.current,
        requestParameters.pageSize,
        requestParameters.merchantOrderId,
        requestParameters.orderNo,
        requestParameters.accountId,
        requestParameters.status,
        requestParameters.payStatus,
        requestParameters.dateRange,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 提交订单
   * @param {JDV2OrderApiApiJdV2OrderSubmitPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2OrderSubmitPost(
    requestParameters: JDV2OrderApiApiJdV2OrderSubmitPostRequest = {},
    options?: RawAxiosRequestConfig
  ) {
    return JDV2OrderApiFp(this.configuration)
      .apiJdV2OrderSubmitPost(
        requestParameters.kamiApiCamelOilV1SubmitOrderReq,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }
}

export enum ApiJdV2OrderAccountOrdersGetPageSizeEnum {
  NUMBER_5 = 5,
  NUMBER_10 = 10,
  NUMBER_15 = 15,
  NUMBER_20 = 20,
  NUMBER_50 = 50,
  NUMBER_100 = 100
}
export enum ApiJdV2OrderAccountOrdersGetStatusEnum {
  NUMBER_2 = 2,
  NUMBER_3 = 3,
  NUMBER_0 = 0,
  NUMBER_1 = 1
}
export enum ApiJdV2OrderAccountOrdersGetPayStatusEnum {
  NUMBER_1 = 1,
  NUMBER_2 = 2,
  NUMBER_3 = 3,
  NUMBER_0 = 0
}
export enum ApiJdV2OrderHistoryGetPageSizeEnum {
  NUMBER_5 = 5,
  NUMBER_10 = 10,
  NUMBER_15 = 15,
  NUMBER_20 = 20,
  NUMBER_50 = 50,
  NUMBER_100 = 100
}
export enum ApiJdV2OrderListGetPageSizeEnum {
  NUMBER_5 = 5,
  NUMBER_10 = 10,
  NUMBER_15 = 15,
  NUMBER_20 = 20,
  NUMBER_50 = 50,
  NUMBER_100 = 100
}
export enum ApiJdV2OrderListGetStatusEnum {
  NUMBER_2 = 2,
  NUMBER_3 = 3,
  NUMBER_0 = 0,
  NUMBER_1 = 1
}
export enum ApiJdV2OrderListGetPayStatusEnum {
  NUMBER_1 = 1,
  NUMBER_2 = 2,
  NUMBER_3 = 3,
  NUMBER_0 = 0
}
