/* 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 { QueryAgreementInstInstallmentResp } from '../models';
// @ts-ignore
import type { QueryAgreementInstantResp } from '../models';
/**
 * AgreementManagementApi - axios parameter creator
 * @export
 */
export const AgreementManagementApiAxiosParamCreator = function (configuration?: Configuration) {
    return {
        /**
         * Query installment/rebate information of agreement instance based on agreement instance ID.
         * @summary Query Agreement Instant Installment Plan
         * @param {number} agreementInstId Identifier for the agreement instance.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet: async (agreementInstId: number, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            // verify required parameter 'agreementInstId' is not null or undefined
            assertParamExists('dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet', 'agreementInstId', agreementInstId)
            const localVarPath = `/dxp/agreement-management/v1/agreement-inst/{agreementInstId}/installments`
                .replace(`{${"agreementInstId"}}`, encodeURIComponent(String(agreementInstId)));
            // 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 the list of subscriber agreement instances based on subscriber ID and service number.  Note: &quot;subsId&quot;, &quot;serviceNumber&quot; cannot both be empty.
         * @summary Query Agreement Instant List
         * @param {number} [subsId] The unique identifier for the subscriber.
         * @param {string} [prefix] The prefix associated with the subscriber\&#39;s service number.
         * @param {string} [serviceNumber] The service number associated with the subscriber.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpAgreementManagementV1AgreementInstListGet: async (subsId?: number, prefix?: string, serviceNumber?: string, options: RawAxiosRequestConfig = {}): Promise<RequestArgs> => {
            const localVarPath = `/dxp/agreement-management/v1/agreement-inst/list`;
            // use dummy base URL string because the URL constructor only accepts absolute URLs.
            const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
            let baseOptions;
            if (configuration) {
                baseOptions = configuration.baseOptions;
            }

            const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
            const localVarHeaderParameter = {} as any;
            const localVarQueryParameter = {} as any;

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

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

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


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

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

/**
 * AgreementManagementApi - functional programming interface
 * @export
 */
export const AgreementManagementApiFp = function(configuration?: Configuration) {
    const localVarAxiosParamCreator = AgreementManagementApiAxiosParamCreator(configuration)
    return {
        /**
         * Query installment/rebate information of agreement instance based on agreement instance ID.
         * @summary Query Agreement Instant Installment Plan
         * @param {number} agreementInstId Identifier for the agreement instance.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId: number, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryAgreementInstInstallmentResp>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AgreementManagementApi.dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
        /**
         * Query the list of subscriber agreement instances based on subscriber ID and service number.  Note: &quot;subsId&quot;, &quot;serviceNumber&quot; cannot both be empty.
         * @summary Query Agreement Instant List
         * @param {number} [subsId] The unique identifier for the subscriber.
         * @param {string} [prefix] The prefix associated with the subscriber\&#39;s service number.
         * @param {string} [serviceNumber] The service number associated with the subscriber.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        async dxpAgreementManagementV1AgreementInstListGet(subsId?: number, prefix?: string, serviceNumber?: string, options?: RawAxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<QueryAgreementInstantResp>> {
            const localVarAxiosArgs = await localVarAxiosParamCreator.dxpAgreementManagementV1AgreementInstListGet(subsId, prefix, serviceNumber, options);
            const localVarOperationServerIndex = configuration?.serverIndex ?? 0;
            const localVarOperationServerBasePath = operationServerMap['AgreementManagementApi.dxpAgreementManagementV1AgreementInstListGet']?.[localVarOperationServerIndex]?.url;
            return (axios, basePath) => createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration)(axios, localVarOperationServerBasePath || basePath);
        },
    }
};

/**
 * AgreementManagementApi - factory interface
 * @export
 */
export const AgreementManagementApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
    const localVarFp = AgreementManagementApiFp(configuration)
    return {
        /**
         * Query installment/rebate information of agreement instance based on agreement instance ID.
         * @summary Query Agreement Instant Installment Plan
         * @param {number} agreementInstId Identifier for the agreement instance.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId: number, options?: any): AxiosPromise<QueryAgreementInstInstallmentResp> {
            return localVarFp.dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId, options).then((request) => request(axios, basePath));
        },
        /**
         * Query the list of subscriber agreement instances based on subscriber ID and service number.  Note: &quot;subsId&quot;, &quot;serviceNumber&quot; cannot both be empty.
         * @summary Query Agreement Instant List
         * @param {number} [subsId] The unique identifier for the subscriber.
         * @param {string} [prefix] The prefix associated with the subscriber\&#39;s service number.
         * @param {string} [serviceNumber] The service number associated with the subscriber.
         * @param {*} [options] Override http request option.
         * @throws {RequiredError}
         */
        dxpAgreementManagementV1AgreementInstListGet(subsId?: number, prefix?: string, serviceNumber?: string, options?: any): AxiosPromise<QueryAgreementInstantResp> {
            return localVarFp.dxpAgreementManagementV1AgreementInstListGet(subsId, prefix, serviceNumber, options).then((request) => request(axios, basePath));
        },
    };
};

/**
 * AgreementManagementApi - interface
 * @export
 * @interface AgreementManagementApi
 */
export interface AgreementManagementApiInterface {
    /**
     * Query installment/rebate information of agreement instance based on agreement instance ID.
     * @summary Query Agreement Instant Installment Plan
     * @param {number} agreementInstId Identifier for the agreement instance.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgreementManagementApiInterface
     */
    dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId: number, options?: RawAxiosRequestConfig): AxiosPromise<QueryAgreementInstInstallmentResp>;

    /**
     * Query the list of subscriber agreement instances based on subscriber ID and service number.  Note: &quot;subsId&quot;, &quot;serviceNumber&quot; cannot both be empty.
     * @summary Query Agreement Instant List
     * @param {number} [subsId] The unique identifier for the subscriber.
     * @param {string} [prefix] The prefix associated with the subscriber\&#39;s service number.
     * @param {string} [serviceNumber] The service number associated with the subscriber.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgreementManagementApiInterface
     */
    dxpAgreementManagementV1AgreementInstListGet(subsId?: number, prefix?: string, serviceNumber?: string, options?: RawAxiosRequestConfig): AxiosPromise<QueryAgreementInstantResp>;

}

/**
 * AgreementManagementApi - object-oriented interface
 * @export
 * @class AgreementManagementApi
 * @extends {BaseAPI}
 */
export class AgreementManagementApi extends BaseAPI implements AgreementManagementApiInterface {
    /**
     * Query installment/rebate information of agreement instance based on agreement instance ID.
     * @summary Query Agreement Instant Installment Plan
     * @param {number} agreementInstId Identifier for the agreement instance.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgreementManagementApi
     */
    public dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId: number, options?: RawAxiosRequestConfig) {
        return AgreementManagementApiFp(this.configuration).dxpAgreementManagementV1AgreementInstAgreementInstIdInstallmentsGet(agreementInstId, options).then((request) => request(this.axios, this.basePath));
    }

    /**
     * Query the list of subscriber agreement instances based on subscriber ID and service number.  Note: &quot;subsId&quot;, &quot;serviceNumber&quot; cannot both be empty.
     * @summary Query Agreement Instant List
     * @param {number} [subsId] The unique identifier for the subscriber.
     * @param {string} [prefix] The prefix associated with the subscriber\&#39;s service number.
     * @param {string} [serviceNumber] The service number associated with the subscriber.
     * @param {*} [options] Override http request option.
     * @throws {RequiredError}
     * @memberof AgreementManagementApi
     */
    public dxpAgreementManagementV1AgreementInstListGet(subsId?: number, prefix?: string, serviceNumber?: string, options?: RawAxiosRequestConfig) {
        return AgreementManagementApiFp(this.configuration).dxpAgreementManagementV1AgreementInstListGet(subsId, prefix, serviceNumber, options).then((request) => request(this.axios, this.basePath));
    }
}

