"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.
 */
Object.defineProperty(exports, "__esModule", { value: true });
exports.instanceOfTask = instanceOfTask;
exports.TaskFromJSON = TaskFromJSON;
exports.TaskFromJSONTyped = TaskFromJSONTyped;
exports.TaskToJSON = TaskToJSON;
exports.TaskToJSONTyped = TaskToJSONTyped;
const LogEvent_1 = require("./LogEvent");
const TaskAggregatedStatusEnum_1 = require("./TaskAggregatedStatusEnum");
const TaskStateEnum_1 = require("./TaskStateEnum");
/**
 * Check if a given object implements the Task interface.
 */
function instanceOfTask(value) {
    if (!('actorName' in value) || value['actorName'] === undefined)
        return false;
    if (!('relObjAppLabel' in value) || value['relObjAppLabel'] === undefined)
        return false;
    if (!('relObjModel' in value) || value['relObjModel'] === undefined)
        return false;
    if (!('uid' in value) || value['uid'] === undefined)
        return false;
    if (!('logs' in value) || value['logs'] === undefined)
        return false;
    if (!('previousLogs' in value) || value['previousLogs'] === undefined)
        return false;
    if (!('aggregatedStatus' in value) || value['aggregatedStatus'] === undefined)
        return false;
    if (!('description' in value) || value['description'] === undefined)
        return false;
    return true;
}
function TaskFromJSON(json) {
    return TaskFromJSONTyped(json, false);
}
function TaskFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'messageId': json['message_id'] == null ? undefined : json['message_id'],
        'queueName': json['queue_name'] == null ? undefined : json['queue_name'],
        'actorName': json['actor_name'],
        'state': json['state'] == null ? undefined : (0, TaskStateEnum_1.TaskStateEnumFromJSON)(json['state']),
        'mtime': json['mtime'] == null ? undefined : (new Date(json['mtime'])),
        'retries': json['retries'] == null ? undefined : json['retries'],
        'eta': json['eta'] == null ? undefined : (new Date(json['eta'])),
        'relObjAppLabel': json['rel_obj_app_label'],
        'relObjModel': json['rel_obj_model'],
        'relObjId': json['rel_obj_id'] == null ? undefined : json['rel_obj_id'],
        'uid': json['uid'],
        'logs': (json['logs'].map(LogEvent_1.LogEventFromJSON)),
        'previousLogs': (json['previous_logs'].map(LogEvent_1.LogEventFromJSON)),
        'aggregatedStatus': (0, TaskAggregatedStatusEnum_1.TaskAggregatedStatusEnumFromJSON)(json['aggregated_status']),
        'description': json['description'],
    };
}
function TaskToJSON(json) {
    return TaskToJSONTyped(json, false);
}
function TaskToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'message_id': value['messageId'],
        'queue_name': value['queueName'],
        'actor_name': value['actorName'],
        'state': (0, TaskStateEnum_1.TaskStateEnumToJSON)(value['state']),
        'mtime': value['mtime'] == null ? value['mtime'] : value['mtime'].toISOString(),
        'retries': value['retries'],
        'eta': value['eta'] == null ? value['eta'] : value['eta'].toISOString(),
        'rel_obj_id': value['relObjId'],
        'aggregated_status': (0, TaskAggregatedStatusEnum_1.TaskAggregatedStatusEnumToJSON)(value['aggregatedStatus']),
    };
}
//# sourceMappingURL=Task.js.map