/* 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 { KamiApiCamelOilV1AccountHistoryRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1AccountStatisticsRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1CheckAccountReq } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1CheckAccountRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1ListAccountRes } from '../models';
/**
 * JDV2AccountApi - axios parameter creator
 */
export const JDV2AccountApiAxiosParamCreator = function (
  configuration?: Configuration
) {
  return {
    /**
     *
     * @summary 棂测账号状态
     * @param {KamiApiCamelOilV1CheckAccountReq} [kamiApiCamelOilV1CheckAccountReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountCheckPost: async (
      kamiApiCamelOilV1CheckAccountReq?: KamiApiCamelOilV1CheckAccountReq,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/api/jd-v2/account/check`;
      // 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(
        kamiApiCamelOilV1CheckAccountReq,
        localVarRequestOptions,
        configuration
      );

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

      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 {ApiJdV2AccountListGetPageSizeEnum} pageSize 页码
     * @param {ApiJdV2AccountListGetStatusEnum} [status] 状态筛选
     * @param {string} [keyword] 关键词搜索（账号名称/手机号）
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountListGet: async (
      current: number,
      pageSize: ApiJdV2AccountListGetPageSizeEnum,
      status?: ApiJdV2AccountListGetStatusEnum,
      keyword?: string,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'current' is not null or undefined
      assertParamExists('apiJdV2AccountListGet', 'current', current);
      // verify required parameter 'pageSize' is not null or undefined
      assertParamExists('apiJdV2AccountListGet', 'pageSize', pageSize);
      const localVarPath = `/api/jd-v2/account/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 (status !== undefined) {
        localVarQueryParameter['status'] = status;
      }

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

      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} accountId 账号ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountStatisticsGet: async (
      accountId: number,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      // verify required parameter 'accountId' is not null or undefined
      assertParamExists('apiJdV2AccountStatisticsGet', 'accountId', accountId);
      const localVarPath = `/api/jd-v2/account/statistics`;
      // 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 (accountId !== undefined) {
        localVarQueryParameter['accountId'] = accountId;
      }

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

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

/**
 * JDV2AccountApi - functional programming interface
 */
export const JDV2AccountApiFp = function (configuration?: Configuration) {
  const localVarAxiosParamCreator =
    JDV2AccountApiAxiosParamCreator(configuration);
  return {
    /**
     *
     * @summary 棂测账号状态
     * @param {KamiApiCamelOilV1CheckAccountReq} [kamiApiCamelOilV1CheckAccountReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2AccountCheckPost(
      kamiApiCamelOilV1CheckAccountReq?: KamiApiCamelOilV1CheckAccountReq,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1CheckAccountRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2AccountCheckPost(
          kamiApiCamelOilV1CheckAccountReq,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2AccountApi.apiJdV2AccountCheckPost']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 账号历史记录
     * @param {number} current 页数
     * @param {ApiJdV2AccountHistoryGetPageSizeEnum} pageSize 页码
     * @param {number} accountId 账号ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2AccountHistoryGet(
      current: number,
      pageSize: ApiJdV2AccountHistoryGetPageSizeEnum,
      accountId: number,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1AccountHistoryRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2AccountHistoryGet(
          current,
          pageSize,
          accountId,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2AccountApi.apiJdV2AccountHistoryGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 账号列表
     * @param {number} current 页数
     * @param {ApiJdV2AccountListGetPageSizeEnum} pageSize 页码
     * @param {ApiJdV2AccountListGetStatusEnum} [status] 状态筛选
     * @param {string} [keyword] 关键词搜索（账号名称/手机号）
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2AccountListGet(
      current: number,
      pageSize: ApiJdV2AccountListGetPageSizeEnum,
      status?: ApiJdV2AccountListGetStatusEnum,
      keyword?: string,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1ListAccountRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2AccountListGet(
          current,
          pageSize,
          status,
          keyword,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2AccountApi.apiJdV2AccountListGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 账号统计信息
     * @param {number} accountId 账号ID
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2AccountStatisticsGet(
      accountId: number,
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1AccountStatisticsRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2AccountStatisticsGet(
          accountId,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2AccountApi.apiJdV2AccountStatisticsGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    }
  };
};

/**
 * JDV2AccountApi - factory interface
 */
export const JDV2AccountApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = JDV2AccountApiFp(configuration);
  return {
    /**
     *
     * @summary 棂测账号状态
     * @param {JDV2AccountApiApiJdV2AccountCheckPostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountCheckPost(
      requestParameters: JDV2AccountApiApiJdV2AccountCheckPostRequest = {},
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1CheckAccountRes> {
      return localVarFp
        .apiJdV2AccountCheckPost(
          requestParameters.kamiApiCamelOilV1CheckAccountReq,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 账号历史记录
     * @param {JDV2AccountApiApiJdV2AccountHistoryGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountHistoryGet(
      requestParameters: JDV2AccountApiApiJdV2AccountHistoryGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1AccountHistoryRes> {
      return localVarFp
        .apiJdV2AccountHistoryGet(
          requestParameters.current,
          requestParameters.pageSize,
          requestParameters.accountId,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 账号列表
     * @param {JDV2AccountApiApiJdV2AccountListGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountListGet(
      requestParameters: JDV2AccountApiApiJdV2AccountListGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1ListAccountRes> {
      return localVarFp
        .apiJdV2AccountListGet(
          requestParameters.current,
          requestParameters.pageSize,
          requestParameters.status,
          requestParameters.keyword,
          options
        )
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 账号统计信息
     * @param {JDV2AccountApiApiJdV2AccountStatisticsGetRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2AccountStatisticsGet(
      requestParameters: JDV2AccountApiApiJdV2AccountStatisticsGetRequest,
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1AccountStatisticsRes> {
      return localVarFp
        .apiJdV2AccountStatisticsGet(requestParameters.accountId, options)
        .then(request => request(axios, basePath));
    }
  };
};

/**
 * JDV2AccountApi - interface
 */
export interface JDV2AccountApiInterface {
  /**
   *
   * @summary 棂测账号状态
   * @param {JDV2AccountApiApiJdV2AccountCheckPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2AccountCheckPost(
    requestParameters?: JDV2AccountApiApiJdV2AccountCheckPostRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1CheckAccountRes>;

  /**
   *
   * @summary 账号历史记录
   * @param {JDV2AccountApiApiJdV2AccountHistoryGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2AccountHistoryGet(
    requestParameters: JDV2AccountApiApiJdV2AccountHistoryGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1AccountHistoryRes>;

  /**
   *
   * @summary 账号列表
   * @param {JDV2AccountApiApiJdV2AccountListGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2AccountListGet(
    requestParameters: JDV2AccountApiApiJdV2AccountListGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1ListAccountRes>;

  /**
   *
   * @summary 账号统计信息
   * @param {JDV2AccountApiApiJdV2AccountStatisticsGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2AccountStatisticsGet(
    requestParameters: JDV2AccountApiApiJdV2AccountStatisticsGetRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1AccountStatisticsRes>;
}

/**
 * Request parameters for apiJdV2AccountCheckPost operation in JDV2AccountApi.
 */
export interface JDV2AccountApiApiJdV2AccountCheckPostRequest {
  readonly kamiApiCamelOilV1CheckAccountReq?: KamiApiCamelOilV1CheckAccountReq;
}

/**
 * Request parameters for apiJdV2AccountHistoryGet operation in JDV2AccountApi.
 */
export interface JDV2AccountApiApiJdV2AccountHistoryGetRequest {
  /**
   * 页数
   */
  readonly current: number;

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

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

/**
 * Request parameters for apiJdV2AccountListGet operation in JDV2AccountApi.
 */
export interface JDV2AccountApiApiJdV2AccountListGetRequest {
  /**
   * 页数
   */
  readonly current: number;

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

  /**
   * 状态筛选
   */
  readonly status?: ApiJdV2AccountListGetStatusEnum;

  /**
   * 关键词搜索（账号名称/手机号）
   */
  readonly keyword?: string;
}

/**
 * Request parameters for apiJdV2AccountStatisticsGet operation in JDV2AccountApi.
 */
export interface JDV2AccountApiApiJdV2AccountStatisticsGetRequest {
  /**
   * 账号ID
   */
  readonly accountId: number;
}

/**
 * JDV2AccountApi - object-oriented interface
 */
export class JDV2AccountApi extends BaseAPI implements JDV2AccountApiInterface {
  /**
   *
   * @summary 棂测账号状态
   * @param {JDV2AccountApiApiJdV2AccountCheckPostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2AccountCheckPost(
    requestParameters: JDV2AccountApiApiJdV2AccountCheckPostRequest = {},
    options?: RawAxiosRequestConfig
  ) {
    return JDV2AccountApiFp(this.configuration)
      .apiJdV2AccountCheckPost(
        requestParameters.kamiApiCamelOilV1CheckAccountReq,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 账号历史记录
   * @param {JDV2AccountApiApiJdV2AccountHistoryGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2AccountHistoryGet(
    requestParameters: JDV2AccountApiApiJdV2AccountHistoryGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2AccountApiFp(this.configuration)
      .apiJdV2AccountHistoryGet(
        requestParameters.current,
        requestParameters.pageSize,
        requestParameters.accountId,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 账号列表
   * @param {JDV2AccountApiApiJdV2AccountListGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2AccountListGet(
    requestParameters: JDV2AccountApiApiJdV2AccountListGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2AccountApiFp(this.configuration)
      .apiJdV2AccountListGet(
        requestParameters.current,
        requestParameters.pageSize,
        requestParameters.status,
        requestParameters.keyword,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 账号统计信息
   * @param {JDV2AccountApiApiJdV2AccountStatisticsGetRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2AccountStatisticsGet(
    requestParameters: JDV2AccountApiApiJdV2AccountStatisticsGetRequest,
    options?: RawAxiosRequestConfig
  ) {
    return JDV2AccountApiFp(this.configuration)
      .apiJdV2AccountStatisticsGet(requestParameters.accountId, options)
      .then(request => request(this.axios, this.basePath));
  }
}

export enum ApiJdV2AccountHistoryGetPageSizeEnum {
  NUMBER_5 = 5,
  NUMBER_10 = 10,
  NUMBER_15 = 15,
  NUMBER_20 = 20,
  NUMBER_50 = 50,
  NUMBER_100 = 100
}
export enum ApiJdV2AccountListGetPageSizeEnum {
  NUMBER_5 = 5,
  NUMBER_10 = 10,
  NUMBER_15 = 15,
  NUMBER_20 = 20,
  NUMBER_50 = 50,
  NUMBER_100 = 100
}
export enum ApiJdV2AccountListGetStatusEnum {
  NUMBER_4 = 4,
  NUMBER_2 = 2,
  NUMBER_3 = 3,
  NUMBER_0 = 0,
  NUMBER_1 = 1
}
