/* 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 { KamiApiCamelOilV1GetSettingsRes } from '../models';
// @ts-ignore
import type { KamiApiCamelOilV1UpdateSettingsReq } from '../models';
/**
 * JDV2SettingsApi - axios parameter creator
 */
export const JDV2SettingsApiAxiosParamCreator = function (
  configuration?: Configuration
) {
  return {
    /**
     *
     * @summary 获取骆驼模块设置
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2SettingsGetGet: async (
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/api/jd-v2/settings/get`;
      // 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;

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

      return {
        url: toPathString(localVarUrlObj),
        options: localVarRequestOptions
      };
    },
    /**
     *
     * @summary 更新骆驼模块设置
     * @param {KamiApiCamelOilV1UpdateSettingsReq} [kamiApiCamelOilV1UpdateSettingsReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2SettingsUpdatePost: async (
      kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq,
      options: RawAxiosRequestConfig = {}
    ): Promise<RequestArgs> => {
      const localVarPath = `/api/jd-v2/settings/update`;
      // 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(
        kamiApiCamelOilV1UpdateSettingsReq,
        localVarRequestOptions,
        configuration
      );

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

/**
 * JDV2SettingsApi - functional programming interface
 */
export const JDV2SettingsApiFp = function (configuration?: Configuration) {
  const localVarAxiosParamCreator =
    JDV2SettingsApiAxiosParamCreator(configuration);
  return {
    /**
     *
     * @summary 获取骆驼模块设置
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2SettingsGetGet(
      options?: RawAxiosRequestConfig
    ): Promise<
      (
        axios?: AxiosInstance,
        basePath?: string
      ) => AxiosPromise<KamiApiCamelOilV1GetSettingsRes>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2SettingsGetGet(options);
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2SettingsApi.apiJdV2SettingsGetGet']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    },
    /**
     *
     * @summary 更新骆驼模块设置
     * @param {KamiApiCamelOilV1UpdateSettingsReq} [kamiApiCamelOilV1UpdateSettingsReq]
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    async apiJdV2SettingsUpdatePost(
      kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq,
      options?: RawAxiosRequestConfig
    ): Promise<
      (axios?: AxiosInstance, basePath?: string) => AxiosPromise<object>
    > {
      const localVarAxiosArgs =
        await localVarAxiosParamCreator.apiJdV2SettingsUpdatePost(
          kamiApiCamelOilV1UpdateSettingsReq,
          options
        );
      const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
      const localVarOperationServerBasePath =
        operationServerMap['JDV2SettingsApi.apiJdV2SettingsUpdatePost']?.[
          localVarOperationServerIndex
        ]?.url;
      return (axios, basePath) =>
        createRequestFunction(
          localVarAxiosArgs,
          globalAxios,
          BASE_PATH,
          configuration
        )(axios, localVarOperationServerBasePath || basePath);
    }
  };
};

/**
 * JDV2SettingsApi - factory interface
 */
export const JDV2SettingsApiFactory = function (
  configuration?: Configuration,
  basePath?: string,
  axios?: AxiosInstance
) {
  const localVarFp = JDV2SettingsApiFp(configuration);
  return {
    /**
     *
     * @summary 获取骆驼模块设置
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2SettingsGetGet(
      options?: RawAxiosRequestConfig
    ): AxiosPromise<KamiApiCamelOilV1GetSettingsRes> {
      return localVarFp
        .apiJdV2SettingsGetGet(options)
        .then(request => request(axios, basePath));
    },
    /**
     *
     * @summary 更新骆驼模块设置
     * @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     */
    apiJdV2SettingsUpdatePost(
      requestParameters: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest = {},
      options?: RawAxiosRequestConfig
    ): AxiosPromise<object> {
      return localVarFp
        .apiJdV2SettingsUpdatePost(
          requestParameters.kamiApiCamelOilV1UpdateSettingsReq,
          options
        )
        .then(request => request(axios, basePath));
    }
  };
};

/**
 * JDV2SettingsApi - interface
 */
export interface JDV2SettingsApiInterface {
  /**
   *
   * @summary 获取骆驼模块设置
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2SettingsGetGet(
    options?: RawAxiosRequestConfig
  ): AxiosPromise<KamiApiCamelOilV1GetSettingsRes>;

  /**
   *
   * @summary 更新骆驼模块设置
   * @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  apiJdV2SettingsUpdatePost(
    requestParameters?: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest,
    options?: RawAxiosRequestConfig
  ): AxiosPromise<object>;
}

/**
 * Request parameters for apiJdV2SettingsUpdatePost operation in JDV2SettingsApi.
 */
export interface JDV2SettingsApiApiJdV2SettingsUpdatePostRequest {
  readonly kamiApiCamelOilV1UpdateSettingsReq?: KamiApiCamelOilV1UpdateSettingsReq;
}

/**
 * JDV2SettingsApi - object-oriented interface
 */
export class JDV2SettingsApi
  extends BaseAPI
  implements JDV2SettingsApiInterface
{
  /**
   *
   * @summary 获取骆驼模块设置
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2SettingsGetGet(options?: RawAxiosRequestConfig) {
    return JDV2SettingsApiFp(this.configuration)
      .apiJdV2SettingsGetGet(options)
      .then(request => request(this.axios, this.basePath));
  }

  /**
   *
   * @summary 更新骆驼模块设置
   * @param {JDV2SettingsApiApiJdV2SettingsUpdatePostRequest} requestParameters Request parameters.
   * @param {*} [options] Override http request option.
   * @throws {RequiredError}
   */
  public apiJdV2SettingsUpdatePost(
    requestParameters: JDV2SettingsApiApiJdV2SettingsUpdatePostRequest = {},
    options?: RawAxiosRequestConfig
  ) {
    return JDV2SettingsApiFp(this.configuration)
      .apiJdV2SettingsUpdatePost(
        requestParameters.kamiApiCamelOilV1UpdateSettingsReq,
        options
      )
      .then(request => request(this.axios, this.basePath));
  }
}
