/* 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 { DeviceFactsOSFamily } from "./DeviceFactsOSFamily";
import { DeviceFactsOSFamilyFromJSON, DeviceFactsOSFamilyToJSON } from "./DeviceFactsOSFamily";

/**
 * For example:
 * {"family":"linux","name":"Ubuntu","version":"24.04.3 LTS (Noble Numbat)","arch":"amd64"}
 * {"family": "windows","name":"Server 2022 Datacenter","version":"10.0.20348.4405","arch":"amd64"}
 * {"family": "windows","name":"Server 2022 Datacenter","version":"10.0.20348.4405","arch":"amd64"}
 * {"family": "mac_os", "name": "", "version": "26.2", "arch": "arm64"}
 * @export
 * @interface OperatingSystem
 */
export interface OperatingSystem {
    /**
     *
     * @type {DeviceFactsOSFamily}
     * @memberof OperatingSystem
     */
    family: DeviceFactsOSFamily;
    /**
     * Operating System name, such as 'Server 2022' or 'Ubuntu'
     * @type {string}
     * @memberof OperatingSystem
     */
    name?: string;
    /**
     * Operating System version, must always be the version number but may contain build name
     * @type {string}
     * @memberof OperatingSystem
     */
    version?: string;
    /**
     *
     * @type {string}
     * @memberof OperatingSystem
     */
    arch?: string;
}

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

export function OperatingSystemFromJSON(json: any): OperatingSystem {
    return OperatingSystemFromJSONTyped(json, false);
}

export function OperatingSystemFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): OperatingSystem {
    if (json == null) {
        return json;
    }
    return {
        family: DeviceFactsOSFamilyFromJSON(json["family"]),
        name: json["name"] == null ? undefined : json["name"],
        version: json["version"] == null ? undefined : json["version"],
        arch: json["arch"] == null ? undefined : json["arch"],
    };
}

export function OperatingSystemToJSON(json: any): OperatingSystem {
    return OperatingSystemToJSONTyped(json, false);
}

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

    return {
        family: DeviceFactsOSFamilyToJSON(value["family"]),
        name: value["name"],
        version: value["version"],
        arch: value["arch"],
    };
}
