conekta/conekta-node

View on GitHub
api/payment-link-api.ts

Summary

Maintainability
A
0 mins
Test Coverage
B
88%
/* 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 { Checkout } from '../model';
// @ts-ignore
import { CheckoutResponse } from '../model';
// @ts-ignore
import { CheckoutsResponse } from '../model';
// @ts-ignore
import { EmailCheckoutRequest } from '../model';
// @ts-ignore
import { ModelError } from '../model';
// @ts-ignore
import { SmsCheckoutRequest } from '../model';
/**
 * PaymentLinkApi - axios parameter creator
 * @export
 */
export const PaymentLinkApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * 
         * @summary Cancel Payment Link
         * @param {string} id Identifier of the resource
         * @param {CancelCheckoutAcceptLanguageEnum} [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}
         */
        cancelCheckout: async (id: string, acceptLanguage?: CancelCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('cancelCheckout', 'id', id)
            const localVarPath = `/checkouts/{id}/cancel`
                .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: '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);
            }


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

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Create Unique Payment Link
         * @param {Checkout} checkout requested field for checkout
         * @param {CreateCheckoutAcceptLanguageEnum} [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}
         */
        createCheckout: async (checkout: Checkout, acceptLanguage?: CreateCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'checkout' is not null or undefined
            assertParamExists('createCheckout', 'checkout', checkout)
            const localVarPath = `/checkouts`;
            // 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(checkout, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Send an email
         * @param {string} id Identifier of the resource
         * @param {EmailCheckoutRequest} emailCheckoutRequest requested field for sms checkout
         * @param {EmailCheckoutAcceptLanguageEnum} [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}
         */
        emailCheckout: async (id: string, emailCheckoutRequest: EmailCheckoutRequest, acceptLanguage?: EmailCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('emailCheckout', 'id', id)
            // verify required parameter 'emailCheckoutRequest' is not null or undefined
            assertParamExists('emailCheckout', 'emailCheckoutRequest', emailCheckoutRequest)
            const localVarPath = `/checkouts/{id}/email`
                .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(emailCheckoutRequest, localVarRequestOptions, configuration)

            return {
                url: toPathString(localVarUrlObj),
                options: localVarRequestOptions,
            };
        },
        /**
         * 
         * @summary Get a payment link by ID
         * @param {string} id Identifier of the resource
         * @param {GetCheckoutAcceptLanguageEnum} [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}
         */
        getCheckout: async (id: string, acceptLanguage?: GetCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('getCheckout', 'id', id)
            const localVarPath = `/checkouts/{id}`
                .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 (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,
            };
        },
        /**
         * Returns a list of links generated by the merchant
         * @summary Get a list of payment links
         * @param {GetCheckoutsAcceptLanguageEnum} [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}
         */
        getCheckouts: async (acceptLanguage?: GetCheckoutsAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/checkouts`;
            // 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,
            };
        },
        /**
         * 
         * @summary Send an sms
         * @param {string} id Identifier of the resource
         * @param {SmsCheckoutRequest} smsCheckoutRequest requested field for sms checkout
         * @param {SmsCheckoutAcceptLanguageEnum} [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}
         */
        smsCheckout: async (id: string, smsCheckoutRequest: SmsCheckoutRequest, acceptLanguage?: SmsCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'id' is not null or undefined
            assertParamExists('smsCheckout', 'id', id)
            // verify required parameter 'smsCheckoutRequest' is not null or undefined
            assertParamExists('smsCheckout', 'smsCheckoutRequest', smsCheckoutRequest)
            const localVarPath = `/checkouts/{id}/sms`
                .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(smsCheckoutRequest, localVarRequestOptions, configuration)

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

/**
 * PaymentLinkApi - functional programming interface
 * @export
 */
export const PaymentLinkApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = PaymentLinkApiAxiosParamCreator(configuration)
    return {
        /**
         * 
         * @summary Cancel Payment Link
         * @param {string} id Identifier of the resource
         * @param {CancelCheckoutAcceptLanguageEnum} [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 cancelCheckout(id: string, acceptLanguage?: CancelCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.cancelCheckout(id, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.cancelCheckout']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * 
         * @summary Create Unique Payment Link
         * @param {Checkout} checkout requested field for checkout
         * @param {CreateCheckoutAcceptLanguageEnum} [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 createCheckout(checkout: Checkout, acceptLanguage?: CreateCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.createCheckout(checkout, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.createCheckout']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * 
         * @summary Send an email
         * @param {string} id Identifier of the resource
         * @param {EmailCheckoutRequest} emailCheckoutRequest requested field for sms checkout
         * @param {EmailCheckoutAcceptLanguageEnum} [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 emailCheckout(id: string, emailCheckoutRequest: EmailCheckoutRequest, acceptLanguage?: EmailCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.emailCheckout(id, emailCheckoutRequest, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.emailCheckout']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * 
         * @summary Get a payment link by ID
         * @param {string} id Identifier of the resource
         * @param {GetCheckoutAcceptLanguageEnum} [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 getCheckout(id: string, acceptLanguage?: GetCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getCheckout(id, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.getCheckout']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * Returns a list of links generated by the merchant
         * @summary Get a list of payment links
         * @param {GetCheckoutsAcceptLanguageEnum} [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 getCheckouts(acceptLanguage?: GetCheckoutsAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutsResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.getCheckouts(acceptLanguage, xChildCompanyId, limit, search, next, previous, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.getCheckouts']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
        /**
         * 
         * @summary Send an sms
         * @param {string} id Identifier of the resource
         * @param {SmsCheckoutRequest} smsCheckoutRequest requested field for sms checkout
         * @param {SmsCheckoutAcceptLanguageEnum} [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 smsCheckout(id: string, smsCheckoutRequest: SmsCheckoutRequest, acceptLanguage?: SmsCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<CheckoutResponse>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.smsCheckout(id, smsCheckoutRequest, acceptLanguage, xChildCompanyId, options);
            const index = configuration?.serverIndex ?? 0;
            const operationBasePath = operationServerMap['PaymentLinkApi.smsCheckout']?.[index]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, operationBasePath || basePath);
        },
    }
};

/**
 * PaymentLinkApi - factory interface
 * @export
 */
export const PaymentLinkApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = PaymentLinkApiFp(configuration)
    return {
        /**
         * 
         * @summary Cancel Payment Link
         * @param {string} id Identifier of the resource
         * @param {CancelCheckoutAcceptLanguageEnum} [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}
         */
        cancelCheckout(id: string, acceptLanguage?: CancelCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<CheckoutResponse> {
            return localVarFp.cancelCheckout(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Create Unique Payment Link
         * @param {Checkout} checkout requested field for checkout
         * @param {CreateCheckoutAcceptLanguageEnum} [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}
         */
        createCheckout(checkout: Checkout, acceptLanguage?: CreateCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<CheckoutResponse> {
            return localVarFp.createCheckout(checkout, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Send an email
         * @param {string} id Identifier of the resource
         * @param {EmailCheckoutRequest} emailCheckoutRequest requested field for sms checkout
         * @param {EmailCheckoutAcceptLanguageEnum} [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}
         */
        emailCheckout(id: string, emailCheckoutRequest: EmailCheckoutRequest, acceptLanguage?: EmailCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<CheckoutResponse> {
            return localVarFp.emailCheckout(id, emailCheckoutRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Get a payment link by ID
         * @param {string} id Identifier of the resource
         * @param {GetCheckoutAcceptLanguageEnum} [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}
         */
        getCheckout(id: string, acceptLanguage?: GetCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<CheckoutResponse> {
            return localVarFp.getCheckout(id, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
        /**
         * Returns a list of links generated by the merchant
         * @summary Get a list of payment links
         * @param {GetCheckoutsAcceptLanguageEnum} [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}
         */
        getCheckouts(acceptLanguage?: GetCheckoutsAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: any): AxiosPromise<CheckoutsResponse> {
            return localVarFp.getCheckouts(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(axios, basePath));
        },
        /**
         * 
         * @summary Send an sms
         * @param {string} id Identifier of the resource
         * @param {SmsCheckoutRequest} smsCheckoutRequest requested field for sms checkout
         * @param {SmsCheckoutAcceptLanguageEnum} [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}
         */
        smsCheckout(id: string, smsCheckoutRequest: SmsCheckoutRequest, acceptLanguage?: SmsCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: any): AxiosPromise<CheckoutResponse> {
            return localVarFp.smsCheckout(id, smsCheckoutRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * PaymentLinkApi - interface
 * @export
 * @interface PaymentLinkApi
 */
export interface PaymentLinkApiInterface {
    /**
     * 
     * @summary Cancel Payment Link
     * @param {string} id Identifier of the resource
     * @param {CancelCheckoutAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    cancelCheckout(id: string, acceptLanguage?: CancelCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutResponse>;

    /**
     * 
     * @summary Create Unique Payment Link
     * @param {Checkout} checkout requested field for checkout
     * @param {CreateCheckoutAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    createCheckout(checkout: Checkout, acceptLanguage?: CreateCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutResponse>;

    /**
     * 
     * @summary Send an email
     * @param {string} id Identifier of the resource
     * @param {EmailCheckoutRequest} emailCheckoutRequest requested field for sms checkout
     * @param {EmailCheckoutAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    emailCheckout(id: string, emailCheckoutRequest: EmailCheckoutRequest, acceptLanguage?: EmailCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutResponse>;

    /**
     * 
     * @summary Get a payment link by ID
     * @param {string} id Identifier of the resource
     * @param {GetCheckoutAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    getCheckout(id: string, acceptLanguage?: GetCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutResponse>;

    /**
     * Returns a list of links generated by the merchant
     * @summary Get a list of payment links
     * @param {GetCheckoutsAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    getCheckouts(acceptLanguage?: GetCheckoutsAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutsResponse>;

    /**
     * 
     * @summary Send an sms
     * @param {string} id Identifier of the resource
     * @param {SmsCheckoutRequest} smsCheckoutRequest requested field for sms checkout
     * @param {SmsCheckoutAcceptLanguageEnum} [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 PaymentLinkApiInterface
     */
    smsCheckout(id: string, smsCheckoutRequest: SmsCheckoutRequest, acceptLanguage?: SmsCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig): AxiosPromise<CheckoutResponse>;

}

/**
 * PaymentLinkApi - object-oriented interface
 * @export
 * @class PaymentLinkApi
 * @extends {BaseAPI}
 */
export class PaymentLinkApi extends BaseAPI implements PaymentLinkApiInterface {
    /**
     * 
     * @summary Cancel Payment Link
     * @param {string} id Identifier of the resource
     * @param {CancelCheckoutAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public cancelCheckout(id: string, acceptLanguage?: CancelCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).cancelCheckout(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Create Unique Payment Link
     * @param {Checkout} checkout requested field for checkout
     * @param {CreateCheckoutAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public createCheckout(checkout: Checkout, acceptLanguage?: CreateCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).createCheckout(checkout, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Send an email
     * @param {string} id Identifier of the resource
     * @param {EmailCheckoutRequest} emailCheckoutRequest requested field for sms checkout
     * @param {EmailCheckoutAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public emailCheckout(id: string, emailCheckoutRequest: EmailCheckoutRequest, acceptLanguage?: EmailCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).emailCheckout(id, emailCheckoutRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Get a payment link by ID
     * @param {string} id Identifier of the resource
     * @param {GetCheckoutAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public getCheckout(id: string, acceptLanguage?: GetCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).getCheckout(id, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Returns a list of links generated by the merchant
     * @summary Get a list of payment links
     * @param {GetCheckoutsAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public getCheckouts(acceptLanguage?: GetCheckoutsAcceptLanguageEnum, xChildCompanyId?: string, limit?: number, search?: string, next?: string, previous?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).getCheckouts(acceptLanguage, xChildCompanyId, limit, search, next, previous, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * 
     * @summary Send an sms
     * @param {string} id Identifier of the resource
     * @param {SmsCheckoutRequest} smsCheckoutRequest requested field for sms checkout
     * @param {SmsCheckoutAcceptLanguageEnum} [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 PaymentLinkApi
     */
    public smsCheckout(id: string, smsCheckoutRequest: SmsCheckoutRequest, acceptLanguage?: SmsCheckoutAcceptLanguageEnum, xChildCompanyId?: string, options?: RawAxiosRequestConfig) {
        return PaymentLinkApiFp(this.configuration).smsCheckout(id, smsCheckoutRequest, acceptLanguage, xChildCompanyId, options).then((request) => request(this.axios, this.basePath));
    }
}

/**
 * @export
 */
export const CancelCheckoutAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type CancelCheckoutAcceptLanguageEnum = typeof CancelCheckoutAcceptLanguageEnum[keyof typeof CancelCheckoutAcceptLanguageEnum];
/**
 * @export
 */
export const CreateCheckoutAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type CreateCheckoutAcceptLanguageEnum = typeof CreateCheckoutAcceptLanguageEnum[keyof typeof CreateCheckoutAcceptLanguageEnum];
/**
 * @export
 */
export const EmailCheckoutAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type EmailCheckoutAcceptLanguageEnum = typeof EmailCheckoutAcceptLanguageEnum[keyof typeof EmailCheckoutAcceptLanguageEnum];
/**
 * @export
 */
export const GetCheckoutAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type GetCheckoutAcceptLanguageEnum = typeof GetCheckoutAcceptLanguageEnum[keyof typeof GetCheckoutAcceptLanguageEnum];
/**
 * @export
 */
export const GetCheckoutsAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type GetCheckoutsAcceptLanguageEnum = typeof GetCheckoutsAcceptLanguageEnum[keyof typeof GetCheckoutsAcceptLanguageEnum];
/**
 * @export
 */
export const SmsCheckoutAcceptLanguageEnum = {
    es: 'es',
    en: 'en'
} as const;
export type SmsCheckoutAcceptLanguageEnum = typeof SmsCheckoutAcceptLanguageEnum[keyof typeof SmsCheckoutAcceptLanguageEnum];