/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.0-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.
 */

import { mapValues } from '../runtime';
import type { EventActions } from './EventActions';
import {
    EventActionsFromJSON,
    EventActionsFromJSONTyped,
    EventActionsToJSON,
    EventActionsToJSONTyped,
} from './EventActions';

/**
 * Event Serializer
 * @export
 * @interface PatchedEventRequest
 */
export interface PatchedEventRequest {
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof PatchedEventRequest
     */
    user?: { [key: string]: any; };
    /**
     * 
     * @type {EventActions}
     * @memberof PatchedEventRequest
     */
    action?: EventActions;
    /**
     * 
     * @type {string}
     * @memberof PatchedEventRequest
     */
    app?: string;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof PatchedEventRequest
     */
    context?: { [key: string]: any; };
    /**
     * 
     * @type {string}
     * @memberof PatchedEventRequest
     */
    clientIp?: string | null;
    /**
     * 
     * @type {Date}
     * @memberof PatchedEventRequest
     */
    expires?: Date;
    /**
     * 
     * @type {{ [key: string]: any; }}
     * @memberof PatchedEventRequest
     */
    brand?: { [key: string]: any; };
}



/**
 * Check if a given object implements the PatchedEventRequest interface.
 */
export function instanceOfPatchedEventRequest(value: object): value is PatchedEventRequest {
    return true;
}

export function PatchedEventRequestFromJSON(json: any): PatchedEventRequest {
    return PatchedEventRequestFromJSONTyped(json, false);
}

export function PatchedEventRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedEventRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'user': json['user'] == null ? undefined : json['user'],
        'action': json['action'] == null ? undefined : EventActionsFromJSON(json['action']),
        'app': json['app'] == null ? undefined : json['app'],
        'context': json['context'] == null ? undefined : json['context'],
        'clientIp': json['client_ip'] == null ? undefined : json['client_ip'],
        'expires': json['expires'] == null ? undefined : (new Date(json['expires'])),
        'brand': json['brand'] == null ? undefined : json['brand'],
    };
}

export function PatchedEventRequestToJSON(json: any): PatchedEventRequest {
    return PatchedEventRequestToJSONTyped(json, false);
}

export function PatchedEventRequestToJSONTyped(value?: PatchedEventRequest | null, ignoreDiscriminator: boolean = false): any {
    if (value == null) {
        return value;
    }

    return {
        
        'user': value['user'],
        'action': EventActionsToJSON(value['action']),
        'app': value['app'],
        'context': value['context'],
        'client_ip': value['clientIp'],
        'expires': value['expires'] == null ? undefined : ((value['expires']).toISOString()),
        'brand': value['brand'],
    };
}

