/* tslint:disable */
/* eslint-disable */
/**
 * DXP API
 * 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 { QueryOfferDetailResp } from '../models';
// @ts-ignore
import type { QueryOfferGroupResp } from '../models';
// @ts-ignore
import type { QuerySalesCatalogResp } from '../models';
/**
 * ProductCatalogManagementApi - axios parameter creator
 * @export
 */
export const ProductCatalogManagementApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Query offer details based on offer number.  Note: If scopes are not provided, only basic information is returned.
         * @summary Query Offer Detail
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {string} [channel] Unique identifier for the channel.
         * @param {string} [lang] The language used for the response data.
         * @param {string} [scopes] Scopes associated with the offer. Possible value: imageList，descriptionList
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1OffersOfferNbrGet: async (offerNbr: string, channel?: string, lang?: string, scopes?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'offerNbr' is not null or undefined
            assertParamExists('dxpProductCatalogV1OffersOfferNbrGet', 'offerNbr', offerNbr)
            const localVarPath = `/dxp/product-catalog/v1/offers/{offerNbr}`
                .replace(`{${"offerNbr"}}`, encodeURIComponent(String(offerNbr)));
            // 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 (channel !== undefined) {
                localVarQueryParameter['channel'] = channel;
            }

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

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


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Query the list of offer groups based on the main plan\'s offer Number.
         * @summary Query Offer Group List
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1OffersOfferNbrOfferGroupsGet: async (offerNbr: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'offerNbr' is not null or undefined
            assertParamExists('dxpProductCatalogV1OffersOfferNbrOfferGroupsGet', 'offerNbr', offerNbr)
            const localVarPath = `/dxp/product-catalog/v1/offers/{offerNbr}/offer-groups`
                .replace(`{${"offerNbr"}}`, encodeURIComponent(String(offerNbr)));
            // 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,
            };
        },
        /**
         * Query sales catalog list based on parent sales catalog code.
         * @summary Query Sales Catalog List
         * @param {string} [parentCatgCode] The code of the parent catalog.
         * @param {boolean} [includeChildren] A flag indicating whether to recursively query children categories in the response.
         * @param {string} [lang] The language used for the response data.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1SalesCatalogsGet: async (parentCatgCode?: string, includeChildren?: boolean, lang?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/dxp/product-catalog/v1/sales-catalogs`;
            // 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 (parentCatgCode !== undefined) {
                localVarQueryParameter['parentCatgCode'] = parentCatgCode;
            }

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

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


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

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

/**
 * ProductCatalogManagementApi - functional programming interface
 * @export
 */
export const ProductCatalogManagementApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = ProductCatalogManagementApiAxiosParamCreator(configuration)
    return {
        /**
         * Query offer details based on offer number.  Note: If scopes are not provided, only basic information is returned.
         * @summary Query Offer Detail
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {string} [channel] Unique identifier for the channel.
         * @param {string} [lang] The language used for the response data.
         * @param {string} [scopes] Scopes associated with the offer. Possible value: imageList，descriptionList
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dxpProductCatalogV1OffersOfferNbrGet(offerNbr: string, channel?: string, lang?: string, scopes?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryOfferDetailResp>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dxpProductCatalogV1OffersOfferNbrGet(offerNbr, channel, lang, scopes, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ProductCatalogManagementApi.dxpProductCatalogV1OffersOfferNbrGet']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Query the list of offer groups based on the main plan\'s offer Number.
         * @summary Query Offer Group List
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryOfferGroupResp>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ProductCatalogManagementApi.dxpProductCatalogV1OffersOfferNbrOfferGroupsGet']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Query sales catalog list based on parent sales catalog code.
         * @summary Query Sales Catalog List
         * @param {string} [parentCatgCode] The code of the parent catalog.
         * @param {boolean} [includeChildren] A flag indicating whether to recursively query children categories in the response.
         * @param {string} [lang] The language used for the response data.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dxpProductCatalogV1SalesCatalogsGet(parentCatgCode?: string, includeChildren?: boolean, lang?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QuerySalesCatalogResp>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dxpProductCatalogV1SalesCatalogsGet(parentCatgCode, includeChildren, lang, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['ProductCatalogManagementApi.dxpProductCatalogV1SalesCatalogsGet']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * ProductCatalogManagementApi - factory interface
 * @export
 */
export const ProductCatalogManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = ProductCatalogManagementApiFp(configuration)
    return {
        /**
         * Query offer details based on offer number.  Note: If scopes are not provided, only basic information is returned.
         * @summary Query Offer Detail
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {string} [channel] Unique identifier for the channel.
         * @param {string} [lang] The language used for the response data.
         * @param {string} [scopes] Scopes associated with the offer. Possible value: imageList，descriptionList
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1OffersOfferNbrGet(offerNbr: string, channel?: string, lang?: string, scopes?: string, options?: any): AxiosPromise<QueryOfferDetailResp> {
            return localVarFp.dxpProductCatalogV1OffersOfferNbrGet(offerNbr, channel, lang, scopes, options).then((request) => request(axios, basePath));
        },
        /**
         * Query the list of offer groups based on the main plan\'s offer Number.
         * @summary Query Offer Group List
         * @param {string} offerNbr A unique identifier for an offer.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr: string, options?: any): AxiosPromise<QueryOfferGroupResp> {
            return localVarFp.dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr, options).then((request) => request(axios, basePath));
        },
        /**
         * Query sales catalog list based on parent sales catalog code.
         * @summary Query Sales Catalog List
         * @param {string} [parentCatgCode] The code of the parent catalog.
         * @param {boolean} [includeChildren] A flag indicating whether to recursively query children categories in the response.
         * @param {string} [lang] The language used for the response data.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpProductCatalogV1SalesCatalogsGet(parentCatgCode?: string, includeChildren?: boolean, lang?: string, options?: any): AxiosPromise<QuerySalesCatalogResp> {
            return localVarFp.dxpProductCatalogV1SalesCatalogsGet(parentCatgCode, includeChildren, lang, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * ProductCatalogManagementApi - interface
 * @export
 * @interface ProductCatalogManagementApi
 */
export interface ProductCatalogManagementApiInterface {
    /**
     * Query offer details based on offer number.  Note: If scopes are not provided, only basic information is returned.
     * @summary Query Offer Detail
     * @param {string} offerNbr A unique identifier for an offer.
     * @param {string} [channel] Unique identifier for the channel.
     * @param {string} [lang] The language used for the response data.
     * @param {string} [scopes] Scopes associated with the offer. Possible value: imageList，descriptionList
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApiInterface
     */
    dxpProductCatalogV1OffersOfferNbrGet(offerNbr: string, channel?: string, lang?: string, scopes?: string, options?: RawAxiosRequestConfig): AxiosPromise<QueryOfferDetailResp>;

    /**
     * Query the list of offer groups based on the main plan\'s offer Number.
     * @summary Query Offer Group List
     * @param {string} offerNbr A unique identifier for an offer.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApiInterface
     */
    dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr: string, options?: RawAxiosRequestConfig): AxiosPromise<QueryOfferGroupResp>;

    /**
     * Query sales catalog list based on parent sales catalog code.
     * @summary Query Sales Catalog List
     * @param {string} [parentCatgCode] The code of the parent catalog.
     * @param {boolean} [includeChildren] A flag indicating whether to recursively query children categories in the response.
     * @param {string} [lang] The language used for the response data.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApiInterface
     */
    dxpProductCatalogV1SalesCatalogsGet(parentCatgCode?: string, includeChildren?: boolean, lang?: string, options?: RawAxiosRequestConfig): AxiosPromise<QuerySalesCatalogResp>;

}

/**
 * ProductCatalogManagementApi - object-oriented interface
 * @export
 * @class ProductCatalogManagementApi
 * @extends {BaseAPI}
 */
export class ProductCatalogManagementApi extends BaseAPI implements ProductCatalogManagementApiInterface {
    /**
     * Query offer details based on offer number.  Note: If scopes are not provided, only basic information is returned.
     * @summary Query Offer Detail
     * @param {string} offerNbr A unique identifier for an offer.
     * @param {string} [channel] Unique identifier for the channel.
     * @param {string} [lang] The language used for the response data.
     * @param {string} [scopes] Scopes associated with the offer. Possible value: imageList，descriptionList
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApi
     */
    public dxpProductCatalogV1OffersOfferNbrGet(offerNbr: string, channel?: string, lang?: string, scopes?: string, options?: RawAxiosRequestConfig) {
        return ProductCatalogManagementApiFp(this.configuration).dxpProductCatalogV1OffersOfferNbrGet(offerNbr, channel, lang, scopes, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Query the list of offer groups based on the main plan\'s offer Number.
     * @summary Query Offer Group List
     * @param {string} offerNbr A unique identifier for an offer.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApi
     */
    public dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr: string, options?: RawAxiosRequestConfig) {
        return ProductCatalogManagementApiFp(this.configuration).dxpProductCatalogV1OffersOfferNbrOfferGroupsGet(offerNbr, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Query sales catalog list based on parent sales catalog code.
     * @summary Query Sales Catalog List
     * @param {string} [parentCatgCode] The code of the parent catalog.
     * @param {boolean} [includeChildren] A flag indicating whether to recursively query children categories in the response.
     * @param {string} [lang] The language used for the response data.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof ProductCatalogManagementApi
     */
    public dxpProductCatalogV1SalesCatalogsGet(parentCatgCode?: string, includeChildren?: boolean, lang?: string, options?: RawAxiosRequestConfig) {
        return ProductCatalogManagementApiFp(this.configuration).dxpProductCatalogV1SalesCatalogsGet(parentCatgCode, includeChildren, lang, options).then((request) => request(this.axios, this.basePath));
    }
}

