"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.PricePlansApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class PricePlansApi extends runtime.BaseAPI {
    /**
     * Get all price plans associated with a vendor.
     * Get All Price Plans
     */
    async pricePlansGetRaw(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: `/price_plans/`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.PricePlanFromJSON));
    }
    /**
     * Get all price plans associated with a vendor.
     * Get All Price Plans
     */
    async pricePlansGet(initOverrides) {
        const response = await this.pricePlansGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Update metered component usage limits in place
     * Update Metered Component Limits
     */
    async pricePlansMeteredComponentsUuidUpdateLimitsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid', 'Required parameter requestParameters.uuid was null or undefined when calling pricePlansMeteredComponentsUuidUpdateLimitsPost.');
        }
        if (requestParameters.updateMeteredComponentLimitsInput === null || requestParameters.updateMeteredComponentLimitsInput === undefined) {
            throw new runtime.RequiredError('updateMeteredComponentLimitsInput', 'Required parameter requestParameters.updateMeteredComponentLimitsInput was null or undefined when calling pricePlansMeteredComponentsUuidUpdateLimitsPost.');
        }
        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: `/price_plans/metered_components/{uuid}/update_limits`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdateMeteredComponentLimitsInputToJSON)(requestParameters.updateMeteredComponentLimitsInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.MeteredComponentFromJSON)(jsonValue));
    }
    /**
     * Update metered component usage limits in place
     * Update Metered Component Limits
     */
    async pricePlansMeteredComponentsUuidUpdateLimitsPost(requestParameters, initOverrides) {
        const response = await this.pricePlansMeteredComponentsUuidUpdateLimitsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * List all price plans with pagination.
     * Get Paginated Price Plans
     */
    async pricePlansPaginateGetRaw(requestParameters, initOverrides) {
        const queryParameters = {};
        if (requestParameters.names) {
            queryParameters['names'] = requestParameters.names;
        }
        if (requestParameters.sortDirection !== undefined) {
            queryParameters['sort_direction'] = requestParameters.sortDirection;
        }
        if (requestParameters.tags) {
            queryParameters['tags'] = requestParameters.tags;
        }
        if (requestParameters.forwardSecondarySortOffset !== undefined) {
            queryParameters['forward_secondary_sort_offset'] = requestParameters.forwardSecondarySortOffset;
        }
        if (requestParameters.limit !== undefined) {
            queryParameters['limit'] = requestParameters.limit;
        }
        if (requestParameters.forwardSortOffset !== undefined) {
            queryParameters['forward_sort_offset'] = requestParameters.forwardSortOffset;
        }
        if (requestParameters.sortColumn !== undefined) {
            queryParameters['sort_column'] = requestParameters.sortColumn;
        }
        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: `/price_plans/paginate`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.ListPricePlansFromJSON)(jsonValue));
    }
    /**
     * List all price plans with pagination.
     * Get Paginated Price Plans
     */
    async pricePlansPaginateGet(requestParameters = {}, initOverrides) {
        const response = await this.pricePlansPaginateGetRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Create a price plan for a vendor.
     * Create Price Plan
     */
    async pricePlansPostRaw(requestParameters, initOverrides) {
        if (requestParameters.createPricePlanArgs === null || requestParameters.createPricePlanArgs === undefined) {
            throw new runtime.RequiredError('createPricePlanArgs', 'Required parameter requestParameters.createPricePlanArgs was null or undefined when calling pricePlansPost.');
        }
        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: `/price_plans/`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.CreatePricePlanArgsToJSON)(requestParameters.createPricePlanArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Create a price plan for a vendor.
     * Create Price Plan
     */
    async pricePlansPost(requestParameters, initOverrides) {
        const response = await this.pricePlansPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Archive a price plan that has no active/scheduled subscription.
     * Archive Price Plan
     */
    async pricePlansPricePlanNameArchivePostRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansPricePlanNameArchivePost.');
        }
        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: `/price_plans/{price_plan_name}/archive`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Archive a price plan that has no active/scheduled subscription.
     * Archive Price Plan
     */
    async pricePlansPricePlanNameArchivePost(requestParameters, initOverrides) {
        await this.pricePlansPricePlanNameArchivePostRaw(requestParameters, initOverrides);
    }
    /**
     * Delete an existing Price Plan. Price Plans which map to active Subscriptions must be replaced or removed before deletion can occur.
     * Delete Price Plan
     */
    async pricePlansPricePlanNameDeleteRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansPricePlanNameDelete.');
        }
        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: `/price_plans/{price_plan_name}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))),
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Delete an existing Price Plan. Price Plans which map to active Subscriptions must be replaced or removed before deletion can occur.
     * Delete Price Plan
     */
    async pricePlansPricePlanNameDelete(requestParameters, initOverrides) {
        await this.pricePlansPricePlanNameDeleteRaw(requestParameters, initOverrides);
    }
    /**
     * Fetch an existing price plan.
     * Get a Price Plan
     */
    async pricePlansPricePlanNameGetRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansPricePlanNameGet.');
        }
        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: `/price_plans/{price_plan_name}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Fetch an existing price plan.
     * Get a Price Plan
     */
    async pricePlansPricePlanNameGet(requestParameters, initOverrides) {
        const response = await this.pricePlansPricePlanNameGetRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Update an existing price plan.
     * Update a Price Plan
     */
    async pricePlansPricePlanNamePutRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansPricePlanNamePut.');
        }
        if (requestParameters.updatePricePlanArgs === null || requestParameters.updatePricePlanArgs === undefined) {
            throw new runtime.RequiredError('updatePricePlanArgs', 'Required parameter requestParameters.updatePricePlanArgs was null or undefined when calling pricePlansPricePlanNamePut.');
        }
        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: `/price_plans/{price_plan_name}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))),
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdatePricePlanArgsToJSON)(requestParameters.updatePricePlanArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Update an existing price plan.
     * Update a Price Plan
     */
    async pricePlansPricePlanNamePut(requestParameters, initOverrides) {
        const response = await this.pricePlansPricePlanNamePutRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get an existing price plan.
     * Get a Price Plan
     */
    async pricePlansPricePlanNameTagGetRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansPricePlanNameTagGet.');
        }
        if (requestParameters.tag === null || requestParameters.tag === undefined) {
            throw new runtime.RequiredError('tag', 'Required parameter requestParameters.tag was null or undefined when calling pricePlansPricePlanNameTagGet.');
        }
        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: `/price_plans/{price_plan_name}/{tag}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))).replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))),
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Get an existing price plan.
     * Get a Price Plan
     */
    async pricePlansPricePlanNameTagGet(requestParameters, initOverrides) {
        const response = await this.pricePlansPricePlanNameTagGetRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Get all price plans marked for self serve for this vendor.
     * Get All Self Serve Price Plans
     */
    async pricePlansSelfServeGetRaw(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: `/price_plans/self_serve`,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(models_1.PricePlanFromJSON));
    }
    /**
     * Get all price plans marked for self serve for this vendor.
     * Get All Self Serve Price Plans
     */
    async pricePlansSelfServeGet(initOverrides) {
        const response = await this.pricePlansSelfServeGetRaw(initOverrides);
        return await response.value();
    }
    /**
     * Set the exhaustive list of price plans that the customer can see and select via self serve.
     * Set Self Serve Price Plans
     */
    async pricePlansSelfServePostRaw(requestParameters, initOverrides) {
        if (requestParameters.selfServePricePlansInputArgs === null || requestParameters.selfServePricePlansInputArgs === undefined) {
            throw new runtime.RequiredError('selfServePricePlansInputArgs', 'Required parameter requestParameters.selfServePricePlansInputArgs was null or undefined when calling pricePlansSelfServePost.');
        }
        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: `/price_plans/self_serve`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.SelfServePricePlansInputArgsToJSON)(requestParameters.selfServePricePlansInputArgs),
        }, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Set the exhaustive list of price plans that the customer can see and select via self serve.
     * Set Self Serve Price Plans
     */
    async pricePlansSelfServePost(requestParameters, initOverrides) {
        await this.pricePlansSelfServePostRaw(requestParameters, initOverrides);
    }
    /**
     * Edit a price plan without creating a new version.
     * Update Price Plan In Place
     */
    async pricePlansUpdateInPlacePricePlanNamePostRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansUpdateInPlacePricePlanNamePost.');
        }
        if (requestParameters.updatePricePlanInPlaceArgs === null || requestParameters.updatePricePlanInPlaceArgs === undefined) {
            throw new runtime.RequiredError('updatePricePlanInPlaceArgs', 'Required parameter requestParameters.updatePricePlanInPlaceArgs was null or undefined when calling pricePlansUpdateInPlacePricePlanNamePost.');
        }
        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: `/price_plans/update_in_place/{price_plan_name}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdatePricePlanInPlaceArgsToJSON)(requestParameters.updatePricePlanInPlaceArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Edit a price plan without creating a new version.
     * Update Price Plan In Place
     */
    async pricePlansUpdateInPlacePricePlanNamePost(requestParameters, initOverrides) {
        const response = await this.pricePlansUpdateInPlacePricePlanNamePostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Edit a price plan without creating a new version.
     * Update Price Plan In Place
     */
    async pricePlansUpdateInPlacePricePlanNameTagPostRaw(requestParameters, initOverrides) {
        if (requestParameters.pricePlanName === null || requestParameters.pricePlanName === undefined) {
            throw new runtime.RequiredError('pricePlanName', 'Required parameter requestParameters.pricePlanName was null or undefined when calling pricePlansUpdateInPlacePricePlanNameTagPost.');
        }
        if (requestParameters.tag === null || requestParameters.tag === undefined) {
            throw new runtime.RequiredError('tag', 'Required parameter requestParameters.tag was null or undefined when calling pricePlansUpdateInPlacePricePlanNameTagPost.');
        }
        if (requestParameters.updatePricePlanInPlaceArgs === null || requestParameters.updatePricePlanInPlaceArgs === undefined) {
            throw new runtime.RequiredError('updatePricePlanInPlaceArgs', 'Required parameter requestParameters.updatePricePlanInPlaceArgs was null or undefined when calling pricePlansUpdateInPlacePricePlanNameTagPost.');
        }
        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: `/price_plans/update_in_place/{price_plan_name}/{tag}`.replace(`{${"price_plan_name"}}`, encodeURIComponent(String(requestParameters.pricePlanName))).replace(`{${"tag"}}`, encodeURIComponent(String(requestParameters.tag))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.UpdatePricePlanInPlaceArgsToJSON)(requestParameters.updatePricePlanInPlaceArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Edit a price plan without creating a new version.
     * Update Price Plan In Place
     */
    async pricePlansUpdateInPlacePricePlanNameTagPost(requestParameters, initOverrides) {
        const response = await this.pricePlansUpdateInPlacePricePlanNameTagPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Add add ons to price plan in place
     * Add AddOns
     */
    async pricePlansUuidAddAddOnsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid', 'Required parameter requestParameters.uuid was null or undefined when calling pricePlansUuidAddAddOnsPost.');
        }
        if (requestParameters.addAddOnsToPricePlanInput === null || requestParameters.addAddOnsToPricePlanInput === undefined) {
            throw new runtime.RequiredError('addAddOnsToPricePlanInput', 'Required parameter requestParameters.addAddOnsToPricePlanInput was null or undefined when calling pricePlansUuidAddAddOnsPost.');
        }
        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: `/price_plans/{uuid}/add_add_ons`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.AddAddOnsToPricePlanInputToJSON)(requestParameters.addAddOnsToPricePlanInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Add add ons to price plan in place
     * Add AddOns
     */
    async pricePlansUuidAddAddOnsPost(requestParameters, initOverrides) {
        const response = await this.pricePlansUuidAddAddOnsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Add features and(or) limits to a price plan in place
     * Add features and limits
     */
    async pricePlansUuidAddFeaturesPostRaw(requestParameters, initOverrides) {
        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid', 'Required parameter requestParameters.uuid was null or undefined when calling pricePlansUuidAddFeaturesPost.');
        }
        if (requestParameters.addFeaturesToPricePlanInput === null || requestParameters.addFeaturesToPricePlanInput === undefined) {
            throw new runtime.RequiredError('addFeaturesToPricePlanInput', 'Required parameter requestParameters.addFeaturesToPricePlanInput was null or undefined when calling pricePlansUuidAddFeaturesPost.');
        }
        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: `/price_plans/{uuid}/add_features`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.AddFeaturesToPricePlanInputToJSON)(requestParameters.addFeaturesToPricePlanInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Add features and(or) limits to a price plan in place
     * Add features and limits
     */
    async pricePlansUuidAddFeaturesPost(requestParameters, initOverrides) {
        const response = await this.pricePlansUuidAddFeaturesPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Add metered components to price plan in place
     * Add Metered Components
     */
    async pricePlansUuidAddMeteredComponentsPostRaw(requestParameters, initOverrides) {
        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid', 'Required parameter requestParameters.uuid was null or undefined when calling pricePlansUuidAddMeteredComponentsPost.');
        }
        if (requestParameters.addMeteredComponentsToPricePlanInput === null || requestParameters.addMeteredComponentsToPricePlanInput === undefined) {
            throw new runtime.RequiredError('addMeteredComponentsToPricePlanInput', 'Required parameter requestParameters.addMeteredComponentsToPricePlanInput was null or undefined when calling pricePlansUuidAddMeteredComponentsPost.');
        }
        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: `/price_plans/{uuid}/add_metered_components`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.AddMeteredComponentsToPricePlanInputToJSON)(requestParameters.addMeteredComponentsToPricePlanInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Add metered components to price plan in place
     * Add Metered Components
     */
    async pricePlansUuidAddMeteredComponentsPost(requestParameters, initOverrides) {
        const response = await this.pricePlansUuidAddMeteredComponentsPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Remove features and(or) limits from a price plan in place
     * Remove features and limits
     */
    async pricePlansUuidRemoveFeaturesPostRaw(requestParameters, initOverrides) {
        if (requestParameters.uuid === null || requestParameters.uuid === undefined) {
            throw new runtime.RequiredError('uuid', 'Required parameter requestParameters.uuid was null or undefined when calling pricePlansUuidRemoveFeaturesPost.');
        }
        if (requestParameters.removeFeaturesFromPricePlanInput === null || requestParameters.removeFeaturesFromPricePlanInput === undefined) {
            throw new runtime.RequiredError('removeFeaturesFromPricePlanInput', 'Required parameter requestParameters.removeFeaturesFromPricePlanInput was null or undefined when calling pricePlansUuidRemoveFeaturesPost.');
        }
        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: `/price_plans/{uuid}/remove_features`.replace(`{${"uuid"}}`, encodeURIComponent(String(requestParameters.uuid))),
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.RemoveFeaturesFromPricePlanInputToJSON)(requestParameters.removeFeaturesFromPricePlanInput),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.PricePlanFromJSON)(jsonValue));
    }
    /**
     * Remove features and(or) limits from a price plan in place
     * Remove features and limits
     */
    async pricePlansUuidRemoveFeaturesPost(requestParameters, initOverrides) {
        const response = await this.pricePlansUuidRemoveFeaturesPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.PricePlansApi = PricePlansApi;
//# sourceMappingURL=data:application/json;base64, 