"use strict";
/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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.instanceOfEvent = instanceOfEvent;
exports.EventFromJSON = EventFromJSON;
exports.EventFromJSONTyped = EventFromJSONTyped;
exports.EventToJSON = EventToJSON;
exports.EventToJSONTyped = EventToJSONTyped;
const EventActions_1 = require("./EventActions");
/**
 * Check if a given object implements the Event interface.
 */
function instanceOfEvent(value) {
    if (!('pk' in value) || value['pk'] === undefined)
        return false;
    if (!('action' in value) || value['action'] === undefined)
        return false;
    if (!('app' in value) || value['app'] === undefined)
        return false;
    if (!('created' in value) || value['created'] === undefined)
        return false;
    return true;
}
function EventFromJSON(json) {
    return EventFromJSONTyped(json, false);
}
function EventFromJSONTyped(json, ignoreDiscriminator) {
    if (json == null) {
        return json;
    }
    return {
        'pk': json['pk'],
        'user': json['user'] == null ? undefined : json['user'],
        'action': (0, EventActions_1.EventActionsFromJSON)(json['action']),
        'app': json['app'],
        'context': json['context'] == null ? undefined : json['context'],
        'clientIp': json['client_ip'] == null ? undefined : json['client_ip'],
        'created': (new Date(json['created'])),
        'expires': json['expires'] == null ? undefined : (new Date(json['expires'])),
        'brand': json['brand'] == null ? undefined : json['brand'],
    };
}
function EventToJSON(json) {
    return EventToJSONTyped(json, false);
}
function EventToJSONTyped(value, ignoreDiscriminator = false) {
    if (value == null) {
        return value;
    }
    return {
        'user': value['user'],
        'action': (0, EventActions_1.EventActionsToJSON)(value['action']),
        'app': value['app'],
        'context': value['context'],
        'client_ip': value['clientIp'],
        'expires': value['expires'] == null ? undefined : ((value['expires']).toISOString()),
        'brand': value['brand'],
    };
}
//# sourceMappingURL=Event.js.map