"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.LifecycleApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class LifecycleApi extends runtime.BaseAPI {
    /**
     * Creates request options for lifecycleIterationsCreate without sending the request
     */
    async lifecycleIterationsCreateRequestOpts(requestParameters) {
        if (requestParameters['lifecycleIterationRequest'] == null) {
            throw new runtime.RequiredError('lifecycleIterationRequest', 'Required parameter "lifecycleIterationRequest" was null or undefined when calling lifecycleIterationsCreate().');
        }
        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 = `/lifecycle/iterations/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.LifecycleIterationRequestToJSON)(requestParameters['lifecycleIterationRequest']),
        };
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleIterationsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleIterationFromJSON)(jsonValue));
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsCreate(requestParameters, initOverrides) {
        const response = await this.lifecycleIterationsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleIterationsLatestRetrieve without sending the request
     */
    async lifecycleIterationsLatestRetrieveRequestOpts(requestParameters) {
        if (requestParameters['contentType'] == null) {
            throw new runtime.RequiredError('contentType', 'Required parameter "contentType" was null or undefined when calling lifecycleIterationsLatestRetrieve().');
        }
        if (requestParameters['objectId'] == null) {
            throw new runtime.RequiredError('objectId', 'Required parameter "objectId" was null or undefined when calling lifecycleIterationsLatestRetrieve().');
        }
        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 = `/lifecycle/iterations/latest/{content_type}/{object_id}/`;
        urlPath = urlPath.replace(`{${"content_type"}}`, encodeURIComponent(String(requestParameters['contentType'])));
        urlPath = urlPath.replace(`{${"object_id"}}`, encodeURIComponent(String(requestParameters['objectId'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsLatestRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleIterationsLatestRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleIterationFromJSON)(jsonValue));
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsLatestRetrieve(requestParameters, initOverrides) {
        const response = await this.lifecycleIterationsLatestRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleIterationsListOpen without sending the request
     */
    async lifecycleIterationsListOpenRequestOpts(requestParameters) {
        const queryParameters = {};
        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['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        if (requestParameters['userIsReviewer'] != null) {
            queryParameters['user_is_reviewer'] = requestParameters['userIsReviewer'];
        }
        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 = `/lifecycle/iterations/open/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsListOpenRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleIterationsListOpenRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedLifecycleIterationListFromJSON)(jsonValue));
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleIterationsListOpen(requestParameters = {}, initOverrides) {
        const response = await this.lifecycleIterationsListOpenRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleReviewsCreate without sending the request
     */
    async lifecycleReviewsCreateRequestOpts(requestParameters) {
        if (requestParameters['reviewRequest'] == null) {
            throw new runtime.RequiredError('reviewRequest', 'Required parameter "reviewRequest" was null or undefined when calling lifecycleReviewsCreate().');
        }
        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 = `/lifecycle/reviews/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.ReviewRequestToJSON)(requestParameters['reviewRequest']),
        };
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleReviewsCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleReviewsCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ReviewFromJSON)(jsonValue));
    }
    /**
     * Mixin to validate that a valid enterprise license exists before allowing to save the object
     */
    async lifecycleReviewsCreate(requestParameters, initOverrides) {
        const response = await this.lifecycleReviewsCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleRulesCreate without sending the request
     */
    async lifecycleRulesCreateRequestOpts(requestParameters) {
        if (requestParameters['lifecycleRuleRequest'] == null) {
            throw new runtime.RequiredError('lifecycleRuleRequest', 'Required parameter "lifecycleRuleRequest" was null or undefined when calling lifecycleRulesCreate().');
        }
        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 = `/lifecycle/rules/`;
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.LifecycleRuleRequestToJSON)(requestParameters['lifecycleRuleRequest']),
        };
    }
    /**
     */
    async lifecycleRulesCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleRuleFromJSON)(jsonValue));
    }
    /**
     */
    async lifecycleRulesCreate(requestParameters, initOverrides) {
        const response = await this.lifecycleRulesCreateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleRulesDestroy without sending the request
     */
    async lifecycleRulesDestroyRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling lifecycleRulesDestroy().');
        }
        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 = `/lifecycle/rules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'DELETE',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async lifecycleRulesDestroyRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesDestroyRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     */
    async lifecycleRulesDestroy(requestParameters, initOverrides) {
        await this.lifecycleRulesDestroyRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for lifecycleRulesList without sending the request
     */
    async lifecycleRulesListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['contentTypeModel'] != null) {
            queryParameters['content_type__model'] = requestParameters['contentTypeModel'];
        }
        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['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 = `/lifecycle/rules/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async lifecycleRulesListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedLifecycleRuleListFromJSON)(jsonValue));
    }
    /**
     */
    async lifecycleRulesList(requestParameters = {}, initOverrides) {
        const response = await this.lifecycleRulesListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleRulesPartialUpdate without sending the request
     */
    async lifecycleRulesPartialUpdateRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling lifecycleRulesPartialUpdate().');
        }
        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 = `/lifecycle/rules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedLifecycleRuleRequestToJSON)(requestParameters['patchedLifecycleRuleRequest']),
        };
    }
    /**
     */
    async lifecycleRulesPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleRuleFromJSON)(jsonValue));
    }
    /**
     */
    async lifecycleRulesPartialUpdate(requestParameters, initOverrides) {
        const response = await this.lifecycleRulesPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleRulesRetrieve without sending the request
     */
    async lifecycleRulesRetrieveRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling lifecycleRulesRetrieve().');
        }
        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 = `/lifecycle/rules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async lifecycleRulesRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleRuleFromJSON)(jsonValue));
    }
    /**
     */
    async lifecycleRulesRetrieve(requestParameters, initOverrides) {
        const response = await this.lifecycleRulesRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for lifecycleRulesUpdate without sending the request
     */
    async lifecycleRulesUpdateRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling lifecycleRulesUpdate().');
        }
        if (requestParameters['lifecycleRuleRequest'] == null) {
            throw new runtime.RequiredError('lifecycleRuleRequest', 'Required parameter "lifecycleRuleRequest" was null or undefined when calling lifecycleRulesUpdate().');
        }
        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 = `/lifecycle/rules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.LifecycleRuleRequestToJSON)(requestParameters['lifecycleRuleRequest']),
        };
    }
    /**
     */
    async lifecycleRulesUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.lifecycleRulesUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.LifecycleRuleFromJSON)(jsonValue));
    }
    /**
     */
    async lifecycleRulesUpdate(requestParameters, initOverrides) {
        const response = await this.lifecycleRulesUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
}
exports.LifecycleApi = LifecycleApi;
//# sourceMappingURL=LifecycleApi.js.map