"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.AdminApi = void 0;
const runtime = __importStar(require("../runtime"));
const models_1 = require("../models");
/**
 *
 */
class AdminApi extends runtime.BaseAPI {
    /**
     * Expires the specified API key and creates a new one.
     * Roll the API Key for a vendor
     */
    async adminApiKeyRollPostRaw(requestParameters, initOverrides) {
        if (requestParameters.rollApiKeyArgs === null || requestParameters.rollApiKeyArgs === undefined) {
            throw new runtime.RequiredError('rollApiKeyArgs', 'Required parameter requestParameters.rollApiKeyArgs was null or undefined when calling adminApiKeyRollPost.');
        }
        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: `/admin/api_key/roll`,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, models_1.RollApiKeyArgsToJSON)(requestParameters.rollApiKeyArgs),
        }, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, models_1.RollApiKeysFromJSON)(jsonValue));
    }
    /**
     * Expires the specified API key and creates a new one.
     * Roll the API Key for a vendor
     */
    async adminApiKeyRollPost(requestParameters, initOverrides) {
        const response = await this.adminApiKeyRollPostRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.AdminApi = AdminApi;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiQWRtaW5BcGkuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi8uLi9zcmMvY29kZWdlbi9hcGlzL0FkbWluQXBpLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7QUFBQSxvQkFBb0I7QUFDcEIsb0JBQW9CO0FBQ3BCOzs7Ozs7Ozs7O0dBVUc7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7QUFHSCxvREFBc0M7QUFDdEMsc0NBT21CO0FBTW5COztHQUVHO0FBQ0gsTUFBYSxRQUFTLFNBQVEsT0FBTyxDQUFDLE9BQU87SUFFekM7OztPQUdHO0lBQ0gsS0FBSyxDQUFDLHNCQUFzQixDQUFDLGlCQUE2QyxFQUFFLGFBQTJCO1FBQ25HLElBQUksaUJBQWlCLENBQUMsY0FBYyxLQUFLLElBQUksSUFBSSxpQkFBaUIsQ0FBQyxjQUFjLEtBQUssU0FBUyxFQUFFO1lBQzdGLE1BQU0sSUFBSSxPQUFPLENBQUMsYUFBYSxDQUFDLGdCQUFnQixFQUFDLDZHQUE2RyxDQUFDLENBQUM7U0FDbks7UUFFRCxNQUFNLGVBQWUsR0FBUSxFQUFFLENBQUM7UUFFaEMsTUFBTSxnQkFBZ0IsR0FBd0IsRUFBRSxDQUFDO1FBRWpELGdCQUFnQixDQUFDLGNBQWMsQ0FBQyxHQUFHLGtCQUF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