"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * Octane API
 * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
 *
 * The version of the OpenAPI document: 1.0.0
 *
 *
 * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
 * https://openapi-generator.tech
 * Do not edit the class manually.
 */
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
}) : (function(o, m, k, k2) {
    if (k2 === undefined) k2 = k;
    o[k2] = m[k];
}));
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
    Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
    o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
    if (mod && mod.__esModule) return mod;
    var result = {};
    if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
    __setModuleDefault(result, mod);
    return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.CustomerPortalApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class CustomerPortalApi extends runtime.BaseAPI {
    /**
     * Fetch the customer\'s active subscription and related information if they exists. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Active Subscription
     */
    async ecpActiveSubscriptionGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/active_subscription`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalActiveSubscriptionFromJSON)(jsonValue));
    }
    /**
     * Fetch the customer\'s active subscription and related information if they exists. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Active Subscription
     */
    async ecpActiveSubscriptionGet(initOverrides) {
        const response = await this.ecpActiveSubscriptionGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Create/update the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Active Subscription
     */
    async ecpActiveSubscriptionPostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalActiveSubscriptionInputArgs === null || requestParameters.customerPortalActiveSubscriptionInputArgs === undefined) {
            throw new runtime.RequiredError('customerPortalActiveSubscriptionInputArgs', 'Required parameter requestParameters.customerPortalActiveSubscriptionInputArgs was null or undefined when calling ecpActiveSubscriptionPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/active_subscription`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalActiveSubscriptionInputArgsToJSON)(requestParameters.customerPortalActiveSubscriptionInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalSubscriptionFromJSON)(jsonValue));
    }
    /**
     * Create/update the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Active Subscription
     */
    async ecpActiveSubscriptionPost(requestParameters, initOverrides) {
        const response = await this.ecpActiveSubscriptionPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Gets the customer\'s contact info. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Contact Info
     */
    async ecpContactInfoGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/contact_info`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ContactInfoFromJSON)(jsonValue));
    }
    /**
     * Gets the customer\'s contact info. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Contact Info
     */
    async ecpContactInfoGet(initOverrides) {
        const response = await this.ecpContactInfoGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Create/update the customer\'s contact info. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Contact Info
     */
    async ecpContactInfoPutRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalContactInfoInputArgs === null || requestParameters.customerPortalContactInfoInputArgs === undefined) {
            throw new runtime.RequiredError('customerPortalContactInfoInputArgs', 'Required parameter requestParameters.customerPortalContactInfoInputArgs was null or undefined when calling ecpContactInfoPut.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/contact_info`,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalContactInfoInputArgsToJSON)(requestParameters.customerPortalContactInfoInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ContactInfoFromJSON)(jsonValue));
    }
    /**
     * Create/update the customer\'s contact info. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Contact Info
     */
    async ecpContactInfoPut(requestParameters, initOverrides) {
        const response = await this.ecpContactInfoPutRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Returns the credit balance. This is a live balance including the accrued revenue in the current cycle. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get the available credit balance.
     */
    async ecpCreditAvailableBalanceGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/credit/available_balance`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalAvailableCreditBalanceFromJSON)(jsonValue));
    }
    /**
     * Returns the credit balance. This is a live balance including the accrued revenue in the current cycle. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get the available credit balance.
     */
    async ecpCreditAvailableBalanceGet(initOverrides) {
        const response = await this.ecpCreditAvailableBalanceGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Returns the customer entire credit ledger. This can be used to compute the current and available credit balance. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Fetch the Credit Ledger
     */
    async ecpCreditLedgerGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/credit/ledger`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.CreditLedgerFromJSON));
    }
    /**
     * Returns the customer entire credit ledger. This can be used to compute the current and available credit balance. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Fetch the Credit Ledger
     */
    async ecpCreditLedgerGet(initOverrides) {
        const response = await this.ecpCreditLedgerGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Purchase the provided amount of credits at the default expiration and price set by the vendor. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Purchase Credits
     */
    async ecpCreditPurchasePostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalCreditPurchase === null || requestParameters.customerPortalCreditPurchase === undefined) {
            throw new runtime.RequiredError('customerPortalCreditPurchase', 'Required parameter requestParameters.customerPortalCreditPurchase was null or undefined when calling ecpCreditPurchasePost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/credit/purchase`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalCreditPurchaseToJSON)(requestParameters.customerPortalCreditPurchase),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CreditGrantFromJSON)(jsonValue));
    }
    /**
     * Purchase the provided amount of credits at the default expiration and price set by the vendor. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Purchase Credits
     */
    async ecpCreditPurchasePost(requestParameters, initOverrides) {
        const response = await this.ecpCreditPurchasePostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Generate the url to the customer portal. This endpoint expects the vendor API key for authentication.
     * Generate Customer Portal Url
     */
    async ecpCustomerPortalUrlPostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalTokenInputArgs === null || requestParameters.customerPortalTokenInputArgs === undefined) {
            throw new runtime.RequiredError('customerPortalTokenInputArgs', 'Required parameter requestParameters.customerPortalTokenInputArgs was null or undefined when calling ecpCustomerPortalUrlPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/customer_portal_url`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalTokenInputArgsToJSON)(requestParameters.customerPortalTokenInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalUrlFromJSON)(jsonValue));
    }
    /**
     * Generate the url to the customer portal. This endpoint expects the vendor API key for authentication.
     * Generate Customer Portal Url
     */
    async ecpCustomerPortalUrlPost(requestParameters, initOverrides) {
        const response = await this.ecpCustomerPortalUrlPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Gets the daily accrued revenue for a customer broken down by line item until the beginning of the current hour. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Daily Accrued Revenue
     */
    async ecpDailyAccruedRevenueGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/daily_accrued_revenue`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.CustomerPortalDailyAccruedRevenueFromJSON));
    }
    /**
     * Gets the daily accrued revenue for a customer broken down by line item until the beginning of the current hour. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Daily Accrued Revenue
     */
    async ecpDailyAccruedRevenueGet(initOverrides) {
        const response = await this.ecpDailyAccruedRevenueGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the customer\'s daily usage filtered by the inputted meter and labels. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Get Daily Usage For Meter
     */
    async ecpFilteredUsagePostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalMeterLabelFilter === null || requestParameters.customerPortalMeterLabelFilter === undefined) {
            throw new runtime.RequiredError('customerPortalMeterLabelFilter', 'Required parameter requestParameters.customerPortalMeterLabelFilter was null or undefined when calling ecpFilteredUsagePost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/filtered_usage`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalMeterLabelFilterToJSON)(requestParameters.customerPortalMeterLabelFilter),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalUsageFromJSON)(jsonValue));
    }
    /**
     * Get the customer\'s daily usage filtered by the inputted meter and labels. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Get Daily Usage For Meter
     */
    async ecpFilteredUsagePost(requestParameters, initOverrides) {
        const response = await this.ecpFilteredUsagePostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get all invoices visible to the given customer. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Invoices
     */
    async ecpInvoicesGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/invoices`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.CustomerPortalInvoiceFromJSON));
    }
    /**
     * Get all invoices visible to the given customer. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Invoices
     */
    async ecpInvoicesGet(initOverrides) {
        const response = await this.ecpInvoicesGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the meters and corresponding primary label keys and values from the customer\'s active subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Meters and Primary Labels
     */
    async ecpMetersGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/meters`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.CustomerPortalMeterFromJSON));
    }
    /**
     * Get the meters and corresponding primary label keys and values from the customer\'s active subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Meters and Primary Labels
     */
    async ecpMetersGet(initOverrides) {
        const response = await this.ecpMetersGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the customer\'s current payment method if it exists in their payment gateway. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Payment Method
     */
    async ecpPaymentMethodGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/payment_method`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalPaymentMethodFromJSON)(jsonValue));
    }
    /**
     * Get the customer\'s current payment method if it exists in their payment gateway. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Payment Method
     */
    async ecpPaymentMethodGet(initOverrides) {
        const response = await this.ecpPaymentMethodGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Gets the customer\'s current payment method status. Returns a 400 if the customer has no configuration or if the current payment provider doesn\'t have customer-level payment status. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Payment Method Status
     */
    async ecpPaymentMethodStatusGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/payment_method_status`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPaymentMethodStatusFromJSON)(jsonValue));
    }
    /**
     * Gets the customer\'s current payment method status. Returns a 400 if the customer has no configuration or if the current payment provider doesn\'t have customer-level payment status. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Payment Method Status
     */
    async ecpPaymentMethodStatusGet(initOverrides) {
        const response = await this.ecpPaymentMethodStatusGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the url to the customer portal. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get the Customer Portal Url
     */
    async ecpPortalUrlGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/portal_url`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalUrlFromJSON)(jsonValue));
    }
    /**
     * Get the url to the customer portal. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get the Customer Portal Url
     */
    async ecpPortalUrlGet(initOverrides) {
        const response = await this.ecpPortalUrlGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get all price plans visible to the given customer for self serve. By default, no price plans are visible. Price plan visibility can be configured by the vendor using the /price_plans/self_serve endpoint. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Price Plans
     */
    async ecpPricePlansGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/price_plans`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.PricePlanFromJSON));
    }
    /**
     * Get all price plans visible to the given customer for self serve. By default, no price plans are visible. Price plan visibility can be configured by the vendor using the /price_plans/self_serve endpoint. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Price Plans
     */
    async ecpPricePlansGet(initOverrides) {
        const response = await this.ecpPricePlansGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the customer\'s self serve customization. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Customization.
     */
    async ecpSelfServeCustomizationGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/self_serve_customization`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeCustomizationFromJSON)(jsonValue));
    }
    /**
     * Get the customer\'s self serve customization. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Customization.
     */
    async ecpSelfServeCustomizationGet(initOverrides) {
        const response = await this.ecpSelfServeCustomizationGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get the customer\'s self serve settings. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Settings.
     */
    async ecpSelfServeSettingsGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/self_serve_settings`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.SelfServeSettingsFromJSON)(jsonValue));
    }
    /**
     * Get the customer\'s self serve settings. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Self Serve Settings.
     */
    async ecpSelfServeSettingsGet(initOverrides) {
        const response = await this.ecpSelfServeSettingsGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Attempt to create a Stripe SetupIntent object. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Create SetupIntent
     */
    async ecpSetupIntentPostRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/setup_intent`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalStripeCredentialFromJSON)(jsonValue));
    }
    /**
     * Attempt to create a Stripe SetupIntent object. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Create SetupIntent
     */
    async ecpSetupIntentPost(initOverrides) {
        const response = await this.ecpSetupIntentPostRaw(initOverrides);
        return await response.value();
    }
    /**
     * Cancel the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Cancel Subscription
     */
    async ecpSubscriptionDeleteRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/subscription`,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Cancel the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Cancel Subscription
     */
    async ecpSubscriptionDelete(initOverrides) {
        await this.ecpSubscriptionDeleteRaw(initOverrides);
    }
    /**
     * Fetch the customer\'s active price plan if it exists. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Price Plan
     */
    async ecpSubscriptionGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/subscription`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalSubscriptionFromJSON)(jsonValue));
    }
    /**
     * Fetch the customer\'s active price plan if it exists. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Price Plan
     */
    async ecpSubscriptionGet(initOverrides) {
        const response = await this.ecpSubscriptionGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Create/update the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Subscription
     */
    async ecpSubscriptionPostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalSubscriptionInputArgs === null || requestParameters.customerPortalSubscriptionInputArgs === undefined) {
            throw new runtime.RequiredError('customerPortalSubscriptionInputArgs', 'Required parameter requestParameters.customerPortalSubscriptionInputArgs was null or undefined when calling ecpSubscriptionPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/subscription`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalSubscriptionInputArgsToJSON)(requestParameters.customerPortalSubscriptionInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalSubscriptionFromJSON)(jsonValue));
    }
    /**
     * Create/update the customer\'s subscription. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name in the request body.
     * Create/Update Subscription
     */
    async ecpSubscriptionPost(requestParameters, initOverrides) {
        const response = await this.ecpSubscriptionPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Generate a customer-scoped JWT to authorize access to ECP endpoints. This endpoint expects the vendor API key for authentication.
     * Exchange Access Token
     */
    async ecpTokenPostRaw(requestParameters, initOverrides) {
        if (requestParameters.customerPortalTokenInputArgs === null || requestParameters.customerPortalTokenInputArgs === undefined) {
            throw new runtime.RequiredError('customerPortalTokenInputArgs', 'Required parameter requestParameters.customerPortalTokenInputArgs was null or undefined when calling ecpTokenPost.');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/token`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CustomerPortalTokenInputArgsToJSON)(requestParameters.customerPortalTokenInputArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalTokenFromJSON)(jsonValue));
    }
    /**
     * Generate a customer-scoped JWT to authorize access to ECP endpoints. This endpoint expects the vendor API key for authentication.
     * Exchange Access Token
     */
    async ecpTokenPost(requestParameters, initOverrides) {
        const response = await this.ecpTokenPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Gets the total accrued revenue for a customer broken down by line item until the beginning of the current hour. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Total Accrued Revenue
     */
    async ecpTotalAccruedRevenueGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/total_accrued_revenue`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalAccruedRevenueFromJSON)(jsonValue));
    }
    /**
     * Gets the total accrued revenue for a customer broken down by line item until the beginning of the current hour. This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Total Accrued Revenue
     */
    async ecpTotalAccruedRevenueGet(initOverrides) {
        const response = await this.ecpTotalAccruedRevenueGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Get relevant information about the customer\'s vendor.This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Vendor Information
     */
    async ecpVendorGetRaw(initOverrides) {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("BearerApiKeyAuth", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        const response = await this.request({
            path: `/ecp/vendor`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.CustomerPortalVendorFromJSON)(jsonValue));
    }
    /**
     * Get relevant information about the customer\'s vendor.This endpoint expects the customer-scoped token for authentication. If using vendor api key, you must also provide the customer name as a url parameter.
     * Get Vendor Information
     */
    async ecpVendorGet(initOverrides) {
        const response = await this.ecpVendorGetRaw(initOverrides);
        return await response.value();
    }
}
exports.CustomerPortalApi = CustomerPortalApi;
//# sourceMappingURL=data:application/json;base64, 