conekta/conekta-node

View on GitHub
api/discounts-api.ts

Summary

Maintainability
A
0 mins
Test Coverage
B
87%
/* tslint:disable */
/* eslint-disable */
/**
 * Conekta API
 * Conekta sdk
 *
 * The version of the OpenAPI document: 2.1.0
 * Contact: engineering@conekta.com
 *
 * 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, RequestArgs, BaseAPI, RequiredError, operationServerMap } from '../base';
// @ts-ignore
import { DiscountLinesResponse } from '../model';
// @ts-ignore
import { GetOrderDiscountLinesResponse } from '../model';
// @ts-ignore
import { ModelError } from '../model';
// @ts-ignore
import { OrderDiscountLinesRequest } from '../model';
// @ts-ignore
import { UpdateOrderDiscountLinesRequest } from '../model';
/**
 * DiscountsApi - axios parameter creator
 * @export
 */
export const DiscountsApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Create discount lines for an existing orden
         * @summary Create Discount
         * @param {string} id Identifier of the resource
         * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersCreateDiscountLine: async (id: string, orderDiscountLinesRequest: OrderDiscountLinesRequest, acceptLanguage?: OrdersCreateDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('ordersCreateDiscountLine', 'id', id)
            // verify required parameter 'orderDiscountLinesRequest' is not null or undefined
            assertParamExists('ordersCreateDiscountLine', 'orderDiscountLinesRequest', orderDiscountLinesRequest)
            const localVarPath = `/orders/{id}/discount_lines`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // 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;

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (acceptLanguage != null) {
                localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
            }

            if (xChildCompanyId != null) {
                localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
            }


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

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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Delete an existing discount lines for an existing orden
         * @summary Delete Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersDeleteDiscountLines: async (id: string, discountLinesId: string, acceptLanguage?: OrdersDeleteDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('ordersDeleteDiscountLines', 'id', id)
            // verify required parameter 'discountLinesId' is not null or undefined
            assertParamExists('ordersDeleteDiscountLines', 'discountLinesId', discountLinesId)
            const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId)));
            // 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: 'DELETE', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (acceptLanguage != null) {
                localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
            }

            if (xChildCompanyId != null) {
                localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get an existing discount lines for an existing orden
         * @summary Get Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersGetDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersGetDiscountLine: async (id: string, discountLinesId: string, acceptLanguage?: OrdersGetDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('ordersGetDiscountLine', 'id', id)
            // verify required parameter 'discountLinesId' is not null or undefined
            assertParamExists('ordersGetDiscountLine', 'discountLinesId', discountLinesId)
            const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId)));
            // 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;

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (acceptLanguage != null) {
                localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
            }

            if (xChildCompanyId != null) {
                localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Get discount lines for an existing orden
         * @summary Get a List of Discount
         * @param {string} id Identifier of the resource
         * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {number} [limit] The numbers of items to return, the maximum value is 250
         * @param {string} [search] General order search, e.g. by mail, reference etc.
         * @param {string} [next] next page
         * @param {string} [previous] previous page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersGetDiscountLines: async (id: string, acceptLanguage?: OrdersGetDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('ordersGetDiscountLines', 'id', id)
            const localVarPath = `/orders/{id}/discount_lines`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)));
            // 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;

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

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

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

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

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

            if (acceptLanguage != null) {
                localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
            }

            if (xChildCompanyId != null) {
                localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * Update an existing discount lines for an existing orden
         * @summary Update Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersUpdateDiscountLines: async (id: string, discountLinesId: string, updateOrderDiscountLinesRequest: UpdateOrderDiscountLinesRequest, acceptLanguage?: OrdersUpdateDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('ordersUpdateDiscountLines', 'id', id)
            // verify required parameter 'discountLinesId' is not null or undefined
            assertParamExists('ordersUpdateDiscountLines', 'discountLinesId', discountLinesId)
            // verify required parameter 'updateOrderDiscountLinesRequest' is not null or undefined
            assertParamExists('ordersUpdateDiscountLines', 'updateOrderDiscountLinesRequest', updateOrderDiscountLinesRequest)
            const localVarPath = `/orders/{id}/discount_lines/{discount_lines_id}`
                .replace(`{${"id"}}`, encodeURIComponent(String(id)))
                .replace(`{${"discount_lines_id"}}`, encodeURIComponent(String(discountLinesId)));
            // 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: 'PUT', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

            // authentication bearerAuth required
            // http bearer authentication required
            await setBearerAuthToObject(localVarHeaderParameter, configuration)

            if (acceptLanguage != null) {
                localVarHeaderParameter['Accept-Language'] = String(acceptLanguage);
            }

            if (xChildCompanyId != null) {
                localVarHeaderParameter['X-Child-Company-Id'] = String(xChildCompanyId);
            }


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

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

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

/**
 * DiscountsApi - functional programming interface
 * @export
 */
export const DiscountsApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = DiscountsApiAxiosParamCreator(configuration)
    return {
        /**
         * Create discount lines for an existing orden
         * @summary Create Discount
         * @param {string} id Identifier of the resource
         * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async ordersCreateDiscountLine(id: string, orderDiscountLinesRequest: OrderDiscountLinesRequest, acceptLanguage?: OrdersCreateDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DiscountLinesResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['DiscountsApi.ordersCreateDiscountLine']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * Delete an existing discount lines for an existing orden
         * @summary Delete Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async ordersDeleteDiscountLines(id: string, discountLinesId: string, acceptLanguage?: OrdersDeleteDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DiscountLinesResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['DiscountsApi.ordersDeleteDiscountLines']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * Get an existing discount lines for an existing orden
         * @summary Get Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersGetDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async ordersGetDiscountLine(id: string, discountLinesId: string, acceptLanguage?: OrdersGetDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DiscountLinesResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['DiscountsApi.ordersGetDiscountLine']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * Get discount lines for an existing orden
         * @summary Get a List of Discount
         * @param {string} id Identifier of the resource
         * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {number} [limit] The numbers of items to return, the maximum value is 250
         * @param {string} [search] General order search, e.g. by mail, reference etc.
         * @param {string} [next] next page
         * @param {string} [previous] previous page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async ordersGetDiscountLines(id: string, acceptLanguage?: OrdersGetDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<GetOrderDiscountLinesResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['DiscountsApi.ordersGetDiscountLines']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * Update an existing discount lines for an existing orden
         * @summary Update Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async ordersUpdateDiscountLines(id: string, discountLinesId: string, updateOrderDiscountLinesRequest: UpdateOrderDiscountLinesRequest, acceptLanguage?: OrdersUpdateDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<DiscountLinesResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['DiscountsApi.ordersUpdateDiscountLines']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
    }
};

/**
 * DiscountsApi - factory interface
 * @export
 */
export const DiscountsApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = DiscountsApiFp(configuration)
    return {
        /**
         * Create discount lines for an existing orden
         * @summary Create Discount
         * @param {string} id Identifier of the resource
         * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersCreateDiscountLine(id: string, orderDiscountLinesRequest: OrderDiscountLinesRequest, acceptLanguage?: OrdersCreateDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<DiscountLinesResponse> {
            return localVarFp.ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * Delete an existing discount lines for an existing orden
         * @summary Delete Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersDeleteDiscountLines(id: string, discountLinesId: string, acceptLanguage?: OrdersDeleteDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<DiscountLinesResponse> {
            return localVarFp.ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get an existing discount lines for an existing orden
         * @summary Get Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {OrdersGetDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersGetDiscountLine(id: string, discountLinesId: string, acceptLanguage?: OrdersGetDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<DiscountLinesResponse> {
            return localVarFp.ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * Get discount lines for an existing orden
         * @summary Get a List of Discount
         * @param {string} id Identifier of the resource
         * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {number} [limit] The numbers of items to return, the maximum value is 250
         * @param {string} [search] General order search, e.g. by mail, reference etc.
         * @param {string} [next] next page
         * @param {string} [previous] previous page
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersGetDiscountLines(id: string, acceptLanguage?: OrdersGetDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: any): AxiosPromise<GetOrderDiscountLinesResponse> {
            return localVarFp.ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath));
        },
        /**
         * Update an existing discount lines for an existing orden
         * @summary Update Discount
         * @param {string} id Identifier of the resource
         * @param {string} discountLinesId discount line id identifier
         * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines
         * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
         * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        ordersUpdateDiscountLines(id: string, discountLinesId: string, updateOrderDiscountLinesRequest: UpdateOrderDiscountLinesRequest, acceptLanguage?: OrdersUpdateDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<DiscountLinesResponse> {
            return localVarFp.ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * DiscountsApi - interface
 * @export
 * @interface DiscountsApi
 */
export interface DiscountsApiInterface {
    /**
     * Create discount lines for an existing orden
     * @summary Create Discount
     * @param {string} id Identifier of the resource
     * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines
     * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApiInterface
     */
    ordersCreateDiscountLine(id: string, orderDiscountLinesRequest: OrderDiscountLinesRequest, acceptLanguage?: OrdersCreateDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<DiscountLinesResponse>;

    /**
     * Delete an existing discount lines for an existing orden
     * @summary Delete Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApiInterface
     */
    ordersDeleteDiscountLines(id: string, discountLinesId: string, acceptLanguage?: OrdersDeleteDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<DiscountLinesResponse>;

    /**
     * Get an existing discount lines for an existing orden
     * @summary Get Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {OrdersGetDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApiInterface
     */
    ordersGetDiscountLine(id: string, discountLinesId: string, acceptLanguage?: OrdersGetDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<DiscountLinesResponse>;

    /**
     * Get discount lines for an existing orden
     * @summary Get a List of Discount
     * @param {string} id Identifier of the resource
     * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {number} [limit] The numbers of items to return, the maximum value is 250
     * @param {string} [search] General order search, e.g. by mail, reference etc.
     * @param {string} [next] next page
     * @param {string} [previous] previous page
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApiInterface
     */
    ordersGetDiscountLines(id: string, acceptLanguage?: OrdersGetDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig): AxiosPromise<GetOrderDiscountLinesResponse>;

    /**
     * Update an existing discount lines for an existing orden
     * @summary Update Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines
     * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApiInterface
     */
    ordersUpdateDiscountLines(id: string, discountLinesId: string, updateOrderDiscountLinesRequest: UpdateOrderDiscountLinesRequest, acceptLanguage?: OrdersUpdateDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<DiscountLinesResponse>;

}

/**
 * DiscountsApi - object-oriented interface
 * @export
 * @class DiscountsApi
 * @extends {BaseAPI}
 */
export class DiscountsApi extends BaseAPI implements DiscountsApiInterface {
    /**
     * Create discount lines for an existing orden
     * @summary Create Discount
     * @param {string} id Identifier of the resource
     * @param {OrderDiscountLinesRequest} orderDiscountLinesRequest requested field for a discount lines
     * @param {OrdersCreateDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApi
     */
    public ordersCreateDiscountLine(id: string, orderDiscountLinesRequest: OrderDiscountLinesRequest, acceptLanguage?: OrdersCreateDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return DiscountsApiFp(this.configuration).ordersCreateDiscountLine(id, orderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Delete an existing discount lines for an existing orden
     * @summary Delete Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {OrdersDeleteDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApi
     */
    public ordersDeleteDiscountLines(id: string, discountLinesId: string, acceptLanguage?: OrdersDeleteDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return DiscountsApiFp(this.configuration).ordersDeleteDiscountLines(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get an existing discount lines for an existing orden
     * @summary Get Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {OrdersGetDiscountLineAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApi
     */
    public ordersGetDiscountLine(id: string, discountLinesId: string, acceptLanguage?: OrdersGetDiscountLineAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return DiscountsApiFp(this.configuration).ordersGetDiscountLine(id, discountLinesId, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Get discount lines for an existing orden
     * @summary Get a List of Discount
     * @param {string} id Identifier of the resource
     * @param {OrdersGetDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {number} [limit] The numbers of items to return, the maximum value is 250
     * @param {string} [search] General order search, e.g. by mail, reference etc.
     * @param {string} [next] next page
     * @param {string} [previous] previous page
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApi
     */
    public ordersGetDiscountLines(id: string, acceptLanguage?: OrdersGetDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig) {
        return DiscountsApiFp(this.configuration).ordersGetDiscountLines(id, acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Update an existing discount lines for an existing orden
     * @summary Update Discount
     * @param {string} id Identifier of the resource
     * @param {string} discountLinesId discount line id identifier
     * @param {UpdateOrderDiscountLinesRequest} updateOrderDiscountLinesRequest requested field for a discount lines
     * @param {OrdersUpdateDiscountLinesAcceptLanguageEnum} [acceptLanguage] Use for knowing which language to use
     * @param {string} [xChildCompanyId] In the case of a holding company, the company id of the child company to which will process the request.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof DiscountsApi
     */
    public ordersUpdateDiscountLines(id: string, discountLinesId: string, updateOrderDiscountLinesRequest: UpdateOrderDiscountLinesRequest, acceptLanguage?: OrdersUpdateDiscountLinesAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return DiscountsApiFp(this.configuration).ordersUpdateDiscountLines(id, discountLinesId, updateOrderDiscountLinesRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }
}

/**
 * @export
 */
export const OrdersCreateDiscountLineAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type OrdersCreateDiscountLineAcceptLanguageEnum = typeof OrdersCreateDiscountLineAcceptLanguageEnum[keyof typeof OrdersCreateDiscountLineAcceptLanguageEnum];
/**
 * @export
 */
export const OrdersDeleteDiscountLinesAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type OrdersDeleteDiscountLinesAcceptLanguageEnum = typeof OrdersDeleteDiscountLinesAcceptLanguageEnum[keyof typeof OrdersDeleteDiscountLinesAcceptLanguageEnum];
/**
 * @export
 */
export const OrdersGetDiscountLineAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type OrdersGetDiscountLineAcceptLanguageEnum = typeof OrdersGetDiscountLineAcceptLanguageEnum[keyof typeof OrdersGetDiscountLineAcceptLanguageEnum];
/**
 * @export
 */
export const OrdersGetDiscountLinesAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type OrdersGetDiscountLinesAcceptLanguageEnum = typeof OrdersGetDiscountLinesAcceptLanguageEnum[keyof typeof OrdersGetDiscountLinesAcceptLanguageEnum];
/**
 * @export
 */
export const OrdersUpdateDiscountLinesAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type OrdersUpdateDiscountLinesAcceptLanguageEnum = typeof OrdersUpdateDiscountLinesAcceptLanguageEnum[keyof typeof OrdersUpdateDiscountLinesAcceptLanguageEnum];