"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.2.0-rc5
 * 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.TasksTasksListStateEnum = exports.TasksTasksListAggregatedStatusEnum = exports.TasksApi = void 0;
const runtime = __importStar(require("../runtime"));
const index_1 = require("../models/index");
/**
 *
 */
class TasksApi extends runtime.BaseAPI {
    /**
     * Creates request options for tasksSchedulesList without sending the request
     */
    async tasksSchedulesListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['actorName'] != null) {
            queryParameters['actor_name'] = requestParameters['actorName'];
        }
        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['paused'] != null) {
            queryParameters['paused'] = requestParameters['paused'];
        }
        if (requestParameters['relObjContentTypeAppLabel'] != null) {
            queryParameters['rel_obj_content_type__app_label'] = requestParameters['relObjContentTypeAppLabel'];
        }
        if (requestParameters['relObjContentTypeModel'] != null) {
            queryParameters['rel_obj_content_type__model'] = requestParameters['relObjContentTypeModel'];
        }
        if (requestParameters['relObjId'] != null) {
            queryParameters['rel_obj_id'] = requestParameters['relObjId'];
        }
        if (requestParameters['relObjIdIsnull'] != null) {
            queryParameters['rel_obj_id__isnull'] = requestParameters['relObjIdIsnull'];
        }
        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 = `/tasks/schedules/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async tasksSchedulesListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksSchedulesListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedScheduleListFromJSON)(jsonValue));
    }
    /**
     */
    async tasksSchedulesList(requestParameters = {}, initOverrides) {
        const response = await this.tasksSchedulesListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksSchedulesPartialUpdate without sending the request
     */
    async tasksSchedulesPartialUpdateRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tasksSchedulesPartialUpdate().');
        }
        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 = `/tasks/schedules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'PATCH',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.PatchedScheduleRequestToJSON)(requestParameters['patchedScheduleRequest']),
        };
    }
    /**
     */
    async tasksSchedulesPartialUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksSchedulesPartialUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScheduleFromJSON)(jsonValue));
    }
    /**
     */
    async tasksSchedulesPartialUpdate(requestParameters, initOverrides) {
        const response = await this.tasksSchedulesPartialUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksSchedulesRetrieve without sending the request
     */
    async tasksSchedulesRetrieveRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tasksSchedulesRetrieve().');
        }
        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 = `/tasks/schedules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async tasksSchedulesRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksSchedulesRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScheduleFromJSON)(jsonValue));
    }
    /**
     */
    async tasksSchedulesRetrieve(requestParameters, initOverrides) {
        const response = await this.tasksSchedulesRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksSchedulesSendCreate without sending the request
     */
    async tasksSchedulesSendCreateRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tasksSchedulesSendCreate().');
        }
        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 = `/tasks/schedules/{id}/send/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Trigger this schedule now
     */
    async tasksSchedulesSendCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksSchedulesSendCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Trigger this schedule now
     */
    async tasksSchedulesSendCreate(requestParameters, initOverrides) {
        await this.tasksSchedulesSendCreateRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for tasksSchedulesUpdate without sending the request
     */
    async tasksSchedulesUpdateRequestOpts(requestParameters) {
        if (requestParameters['id'] == null) {
            throw new runtime.RequiredError('id', 'Required parameter "id" was null or undefined when calling tasksSchedulesUpdate().');
        }
        if (requestParameters['scheduleRequest'] == null) {
            throw new runtime.RequiredError('scheduleRequest', 'Required parameter "scheduleRequest" was null or undefined when calling tasksSchedulesUpdate().');
        }
        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 = `/tasks/schedules/{id}/`;
        urlPath = urlPath.replace(`{${"id"}}`, encodeURIComponent(String(requestParameters['id'])));
        return {
            path: urlPath,
            method: 'PUT',
            headers: headerParameters,
            query: queryParameters,
            body: (0, index_1.ScheduleRequestToJSON)(requestParameters['scheduleRequest']),
        };
    }
    /**
     */
    async tasksSchedulesUpdateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksSchedulesUpdateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.ScheduleFromJSON)(jsonValue));
    }
    /**
     */
    async tasksSchedulesUpdate(requestParameters, initOverrides) {
        const response = await this.tasksSchedulesUpdateRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksTasksList without sending the request
     */
    async tasksTasksListRequestOpts(requestParameters) {
        const queryParameters = {};
        if (requestParameters['actorName'] != null) {
            queryParameters['actor_name'] = requestParameters['actorName'];
        }
        if (requestParameters['aggregatedStatus'] != null) {
            queryParameters['aggregated_status'] = requestParameters['aggregatedStatus'];
        }
        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['queueName'] != null) {
            queryParameters['queue_name'] = requestParameters['queueName'];
        }
        if (requestParameters['relObjContentTypeAppLabel'] != null) {
            queryParameters['rel_obj_content_type__app_label'] = requestParameters['relObjContentTypeAppLabel'];
        }
        if (requestParameters['relObjContentTypeModel'] != null) {
            queryParameters['rel_obj_content_type__model'] = requestParameters['relObjContentTypeModel'];
        }
        if (requestParameters['relObjId'] != null) {
            queryParameters['rel_obj_id'] = requestParameters['relObjId'];
        }
        if (requestParameters['relObjIdIsnull'] != null) {
            queryParameters['rel_obj_id__isnull'] = requestParameters['relObjIdIsnull'];
        }
        if (requestParameters['search'] != null) {
            queryParameters['search'] = requestParameters['search'];
        }
        if (requestParameters['state'] != null) {
            queryParameters['state'] = requestParameters['state'];
        }
        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 = `/tasks/tasks/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async tasksTasksListRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksTasksListRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.PaginatedTaskListFromJSON)(jsonValue));
    }
    /**
     */
    async tasksTasksList(requestParameters = {}, initOverrides) {
        const response = await this.tasksTasksListRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksTasksRetrieve without sending the request
     */
    async tasksTasksRetrieveRequestOpts(requestParameters) {
        if (requestParameters['messageId'] == null) {
            throw new runtime.RequiredError('messageId', 'Required parameter "messageId" was null or undefined when calling tasksTasksRetrieve().');
        }
        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 = `/tasks/tasks/{message_id}/`;
        urlPath = urlPath.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters['messageId'])));
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     */
    async tasksTasksRetrieveRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksTasksRetrieveRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.TaskFromJSON)(jsonValue));
    }
    /**
     */
    async tasksTasksRetrieve(requestParameters, initOverrides) {
        const response = await this.tasksTasksRetrieveRaw(requestParameters, initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksTasksRetryCreate without sending the request
     */
    async tasksTasksRetryCreateRequestOpts(requestParameters) {
        if (requestParameters['messageId'] == null) {
            throw new runtime.RequiredError('messageId', 'Required parameter "messageId" was null or undefined when calling tasksTasksRetryCreate().');
        }
        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 = `/tasks/tasks/{message_id}/retry/`;
        urlPath = urlPath.replace(`{${"message_id"}}`, encodeURIComponent(String(requestParameters['messageId'])));
        return {
            path: urlPath,
            method: 'POST',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Retry task
     */
    async tasksTasksRetryCreateRaw(requestParameters, initOverrides) {
        const requestOptions = await this.tasksTasksRetryCreateRequestOpts(requestParameters);
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.VoidApiResponse(response);
    }
    /**
     * Retry task
     */
    async tasksTasksRetryCreate(requestParameters, initOverrides) {
        await this.tasksTasksRetryCreateRaw(requestParameters, initOverrides);
    }
    /**
     * Creates request options for tasksTasksStatusRetrieve without sending the request
     */
    async tasksTasksStatusRetrieveRequestOpts() {
        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 = `/tasks/tasks/status/`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Global status summary for all tasks
     */
    async tasksTasksStatusRetrieveRaw(initOverrides) {
        const requestOptions = await this.tasksTasksStatusRetrieveRequestOpts();
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => (0, index_1.GlobalTaskStatusFromJSON)(jsonValue));
    }
    /**
     * Global status summary for all tasks
     */
    async tasksTasksStatusRetrieve(initOverrides) {
        const response = await this.tasksTasksStatusRetrieveRaw(initOverrides);
        return await response.value();
    }
    /**
     * Creates request options for tasksWorkersList without sending the request
     */
    async tasksWorkersListRequestOpts() {
        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 = `/tasks/workers`;
        return {
            path: urlPath,
            method: 'GET',
            headers: headerParameters,
            query: queryParameters,
        };
    }
    /**
     * Get currently connected worker count.
     */
    async tasksWorkersListRaw(initOverrides) {
        const requestOptions = await this.tasksWorkersListRequestOpts();
        const response = await this.request(requestOptions, initOverrides);
        return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(index_1.WorkerFromJSON));
    }
    /**
     * Get currently connected worker count.
     */
    async tasksWorkersList(initOverrides) {
        const response = await this.tasksWorkersListRaw(initOverrides);
        return await response.value();
    }
}
exports.TasksApi = TasksApi;
/**
 * @export
 */
exports.TasksTasksListAggregatedStatusEnum = {
    Consumed: 'consumed',
    Done: 'done',
    Error: 'error',
    Info: 'info',
    Postprocess: 'postprocess',
    Preprocess: 'preprocess',
    Queued: 'queued',
    Rejected: 'rejected',
    Running: 'running',
    Warning: 'warning',
    UnknownDefaultOpenApi: '11184809'
};
/**
 * @export
 */
exports.TasksTasksListStateEnum = {
    Consumed: 'consumed',
    Done: 'done',
    Postprocess: 'postprocess',
    Preprocess: 'preprocess',
    Queued: 'queued',
    Rejected: 'rejected',
    Running: 'running',
    UnknownDefaultOpenApi: '11184809'
};
//# sourceMappingURL=TasksApi.js.map