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

/**
 * Response object of Event's top_per_user
 * @export
 * @interface EventTopPerUser
 */
export interface EventTopPerUser {
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof EventTopPerUser
     */
    application: { [key: string]: any };
    /**
     *
     * @type {number}
     * @memberof EventTopPerUser
     */
    countedEvents: number;
    /**
     *
     * @type {number}
     * @memberof EventTopPerUser
     */
    uniqueUsers: number;
}

/**
 * Check if a given object implements the EventTopPerUser interface.
 */
export function instanceOfEventTopPerUser(value: object): value is EventTopPerUser {
    if (!("application" in value) || value["application"] === undefined) return false;
    if (!("countedEvents" in value) || value["countedEvents"] === undefined) return false;
    if (!("uniqueUsers" in value) || value["uniqueUsers"] === undefined) return false;
    return true;
}

export function EventTopPerUserFromJSON(json: any): EventTopPerUser {
    return EventTopPerUserFromJSONTyped(json, false);
}

export function EventTopPerUserFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): EventTopPerUser {
    if (json == null) {
        return json;
    }
    return {
        application: json["application"],
        countedEvents: json["counted_events"],
        uniqueUsers: json["unique_users"],
    };
}

export function EventTopPerUserToJSON(json: any): EventTopPerUser {
    return EventTopPerUserToJSONTyped(json, false);
}

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

    return {
        application: value["application"],
        counted_events: value["countedEvents"],
        unique_users: value["uniqueUsers"],
    };
}
