/* 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.
 */

import type { AuthenticatedSessionUserAgentDevice } from "./AuthenticatedSessionUserAgentDevice";
import {
    AuthenticatedSessionUserAgentDeviceFromJSON,
    AuthenticatedSessionUserAgentDeviceToJSON,
} from "./AuthenticatedSessionUserAgentDevice";
import type { AuthenticatedSessionUserAgentOs } from "./AuthenticatedSessionUserAgentOs";
import {
    AuthenticatedSessionUserAgentOsFromJSON,
    AuthenticatedSessionUserAgentOsToJSON,
} from "./AuthenticatedSessionUserAgentOs";
import type { AuthenticatedSessionUserAgentUserAgent } from "./AuthenticatedSessionUserAgentUserAgent";
import {
    AuthenticatedSessionUserAgentUserAgentFromJSON,
    AuthenticatedSessionUserAgentUserAgentToJSON,
} from "./AuthenticatedSessionUserAgentUserAgent";

/**
 * Get parsed user agent
 * @export
 * @interface AuthenticatedSessionUserAgent
 */
export interface AuthenticatedSessionUserAgent {
    /**
     *
     * @type {AuthenticatedSessionUserAgentDevice}
     * @memberof AuthenticatedSessionUserAgent
     */
    device: AuthenticatedSessionUserAgentDevice;
    /**
     *
     * @type {AuthenticatedSessionUserAgentOs}
     * @memberof AuthenticatedSessionUserAgent
     */
    os: AuthenticatedSessionUserAgentOs;
    /**
     *
     * @type {AuthenticatedSessionUserAgentUserAgent}
     * @memberof AuthenticatedSessionUserAgent
     */
    userAgent: AuthenticatedSessionUserAgentUserAgent;
    /**
     *
     * @type {string}
     * @memberof AuthenticatedSessionUserAgent
     */
    string: string;
}

/**
 * Check if a given object implements the AuthenticatedSessionUserAgent interface.
 */
export function instanceOfAuthenticatedSessionUserAgent(
    value: object,
): value is AuthenticatedSessionUserAgent {
    if (!("device" in value) || value["device"] === undefined) return false;
    if (!("os" in value) || value["os"] === undefined) return false;
    if (!("userAgent" in value) || value["userAgent"] === undefined) return false;
    if (!("string" in value) || value["string"] === undefined) return false;
    return true;
}

export function AuthenticatedSessionUserAgentFromJSON(json: any): AuthenticatedSessionUserAgent {
    return AuthenticatedSessionUserAgentFromJSONTyped(json, false);
}

export function AuthenticatedSessionUserAgentFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): AuthenticatedSessionUserAgent {
    if (json == null) {
        return json;
    }
    return {
        device: AuthenticatedSessionUserAgentDeviceFromJSON(json["device"]),
        os: AuthenticatedSessionUserAgentOsFromJSON(json["os"]),
        userAgent: AuthenticatedSessionUserAgentUserAgentFromJSON(json["user_agent"]),
        string: json["string"],
    };
}

export function AuthenticatedSessionUserAgentToJSON(json: any): AuthenticatedSessionUserAgent {
    return AuthenticatedSessionUserAgentToJSONTyped(json, false);
}

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

    return {
        device: AuthenticatedSessionUserAgentDeviceToJSON(value["device"]),
        os: AuthenticatedSessionUserAgentOsToJSON(value["os"]),
        user_agent: AuthenticatedSessionUserAgentUserAgentToJSON(value["userAgent"]),
        string: value["string"],
    };
}
