"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.2-rc1
 * Contact: hello@goauthentik.io
 *
 * 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;
    var desc = Object.getOwnPropertyDescriptor(m, k);
    if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
      desc = { enumerable: true, get: function() { return m[k]; } };
    }
    Object.defineProperty(o, k2, desc);
}) : (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 () {
    var ownKeys = function(o) {
        ownKeys = Object.getOwnPropertyNames || function (o) {
            var ar = [];
            for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
            return ar;
        };
        return ownKeys(o);
    };
    return function (mod) {
        if (mod && mod.__esModule) return mod;
        var result = {};
        if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
        __setModuleDefault(result, mod);
        return result;
    };
})();
Object.defineProperty(exports, "__esModule", { value: true });
exports.ManagedApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class ManagedApi extends runtime.BaseAPI {
    /**
     * Creates request options for managedBlueprintsApplyCreate without sending the request
     */
    async managedBlueprintsApplyCreateRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsApplyCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/apply/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Apply a blueprint
     */
    async managedBlueprintsApplyCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsApplyCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BlueprintInstanceFromJSON)(jsonValue));
    }
    /**
     * Apply a blueprint
     */
    async managedBlueprintsApplyCreate(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsApplyCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsAvailableList without sending the request
     */
    async managedBlueprintsAvailableListRequestOpts() {
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/available/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get blueprints
     */
    async managedBlueprintsAvailableListRaw(initOverrides) {
        const requestOptions = await this.managedBlueprintsAvailableListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.BlueprintFileFromJSON));
    }
    /**
     * Get blueprints
     */
    async managedBlueprintsAvailableList(initOverrides) {
        const response = await this.managedBlueprintsAvailableListRaw(initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsCreate without sending the request
     */
    async managedBlueprintsCreateRequestOpts(requestParameters) {
        if (requestParameters['blueprintInstanceRequest'] == null) {
            throw new runtime.RequiredError('blueprintInstanceRequest', 'Required parameter "blueprintInstanceRequest" was null or undefined when calling managedBlueprintsCreate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.BlueprintInstanceRequestToJSON)(requestParameters['blueprintInstanceRequest']),
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BlueprintInstanceFromJSON)(jsonValue));
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsCreate(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsDestroy without sending the request
     */
    async managedBlueprintsDestroyRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsDestroy().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsDestroy(requestParameters, initOverrides) {
        await this.managedBlueprintsDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for managedBlueprintsList without sending the request
     */
    async managedBlueprintsListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['name'] != null) {
            queryParameters['name'] = requestParameters['name'];
        }
        if (requestParameters['ordering'] != null) {
            queryParameters['ordering'] = requestParameters['ordering'];
        }
        if (requestParameters['page'] != null) {
            queryParameters['page'] = requestParameters['page'];
        }
        if (requestParameters['pageSize'] != null) {
            queryParameters['page_size'] = requestParameters['pageSize'];
        }
        if (requestParameters['path'] != null) {
            queryParameters['path'] = requestParameters['path'];
        }
        if (requestParameters['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedBlueprintInstanceListFromJSON)(jsonValue));
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsList(requestParameters = {}, initOverrides) {
        const response = await this.managedBlueprintsListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsPartialUpdate without sending the request
     */
    async managedBlueprintsPartialUpdateRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsPartialUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedBlueprintInstanceRequestToJSON)(requestParameters['patchedBlueprintInstanceRequest']),
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BlueprintInstanceFromJSON)(jsonValue));
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsPartialUpdate(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsRetrieve without sending the request
     */
    async managedBlueprintsRetrieveRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsRetrieve().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BlueprintInstanceFromJSON)(jsonValue));
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsRetrieve(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsUpdate without sending the request
     */
    async managedBlueprintsUpdateRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsUpdate().');
        }
        if (requestParameters['blueprintInstanceRequest'] == null) {
            throw new runtime.RequiredError('blueprintInstanceRequest', 'Required parameter "blueprintInstanceRequest" was null or undefined when calling managedBlueprintsUpdate().');
        }
        const queryParameters = {};
        const headerParameters = {};
        headerParameters['Content-Type'] = 'application/json';
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.BlueprintInstanceRequestToJSON)(requestParameters['blueprintInstanceRequest']),
        };
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.BlueprintInstanceFromJSON)(jsonValue));
    }
    /**
     * Blueprint instances
     */
    async managedBlueprintsUpdate(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for managedBlueprintsUsedByList without sending the request
     */
    async managedBlueprintsUsedByListRequestOpts(requestParameters) {
        if (requestParameters['instanceUuid'] == null) {
            throw new runtime.RequiredError('instanceUuid', 'Required parameter "instanceUuid" was null or undefined when calling managedBlueprintsUsedByList().');
        }
        const queryParameters = {};
        const headerParameters = {};
        if (this.configuration && this.configuration.accessToken) {
            const token = this.configuration.accessToken;
            const tokenString = await token("authentik", []);
            if (tokenString) {
                headerParameters["Authorization"] = `Bearer ${tokenString}`;
            }
        }
        let urlPath = `/managed/blueprints/{instance_uuid}/used_by/`;
        urlPath = urlPath.replace(`{${"instance_uuid"}}`, encodeURIComponent(String(requestParameters['instanceUuid'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get a list of all objects that use this object
     */
    async managedBlueprintsUsedByListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.managedBlueprintsUsedByListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.UsedByFromJSON));
    }
    /**
     * Get a list of all objects that use this object
     */
    async managedBlueprintsUsedByList(requestParameters, initOverrides) {
        const response = await this.managedBlueprintsUsedByListRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.ManagedApi = ManagedApi;
//# sourceMappingURL=ManagedApi.js.map