/* 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 { DeviceGroup } from "./DeviceGroup";
import { DeviceGroupFromJSON, DeviceGroupToJSON } from "./DeviceGroup";
import type { DeviceUser } from "./DeviceUser";
import { DeviceUserFromJSON, DeviceUserToJSON } from "./DeviceUser";
import type { Disk } from "./Disk";
import { DiskFromJSON, DiskToJSON } from "./Disk";
import type { Hardware } from "./Hardware";
import { HardwareFromJSON, HardwareToJSON } from "./Hardware";
import type { Network } from "./Network";
import { NetworkFromJSON, NetworkToJSON } from "./Network";
import type { OperatingSystem } from "./OperatingSystem";
import { OperatingSystemFromJSON, OperatingSystemToJSON } from "./OperatingSystem";
import type { Process } from "./Process";
import { ProcessFromJSON, ProcessToJSON } from "./Process";
import type { Software } from "./Software";
import { SoftwareFromJSON, SoftwareToJSON } from "./Software";

/**
 *
 * @export
 * @interface DeviceFacts
 */
export interface DeviceFacts {
    /**
     *
     * @type {OperatingSystem}
     * @memberof DeviceFacts
     */
    os?: OperatingSystem | null;
    /**
     *
     * @type {Array<Disk>}
     * @memberof DeviceFacts
     */
    disks?: Array<Disk> | null;
    /**
     *
     * @type {Network}
     * @memberof DeviceFacts
     */
    network?: Network | null;
    /**
     *
     * @type {Hardware}
     * @memberof DeviceFacts
     */
    hardware?: Hardware | null;
    /**
     *
     * @type {Array<Software>}
     * @memberof DeviceFacts
     */
    software?: Array<Software> | null;
    /**
     *
     * @type {Array<Process>}
     * @memberof DeviceFacts
     */
    processes?: Array<Process> | null;
    /**
     *
     * @type {Array<DeviceUser>}
     * @memberof DeviceFacts
     */
    users?: Array<DeviceUser> | null;
    /**
     *
     * @type {Array<DeviceGroup>}
     * @memberof DeviceFacts
     */
    groups?: Array<DeviceGroup> | null;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof DeviceFacts
     */
    vendor?: { [key: string]: any };
}

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

export function DeviceFactsFromJSON(json: any): DeviceFacts {
    return DeviceFactsFromJSONTyped(json, false);
}

export function DeviceFactsFromJSONTyped(json: any, ignoreDiscriminator: boolean): DeviceFacts {
    if (json == null) {
        return json;
    }
    return {
        os: json["os"] == null ? undefined : OperatingSystemFromJSON(json["os"]),
        disks: json["disks"] == null ? undefined : (json["disks"] as Array<any>).map(DiskFromJSON),
        network: json["network"] == null ? undefined : NetworkFromJSON(json["network"]),
        hardware: json["hardware"] == null ? undefined : HardwareFromJSON(json["hardware"]),
        software:
            json["software"] == null
                ? undefined
                : (json["software"] as Array<any>).map(SoftwareFromJSON),
        processes:
            json["processes"] == null
                ? undefined
                : (json["processes"] as Array<any>).map(ProcessFromJSON),
        users:
            json["users"] == null
                ? undefined
                : (json["users"] as Array<any>).map(DeviceUserFromJSON),
        groups:
            json["groups"] == null
                ? undefined
                : (json["groups"] as Array<any>).map(DeviceGroupFromJSON),
        vendor: json["vendor"] == null ? undefined : json["vendor"],
    };
}

export function DeviceFactsToJSON(json: any): DeviceFacts {
    return DeviceFactsToJSONTyped(json, false);
}

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

    return {
        os: OperatingSystemToJSON(value["os"]),
        disks: value["disks"] == null ? undefined : (value["disks"] as Array<any>).map(DiskToJSON),
        network: NetworkToJSON(value["network"]),
        hardware: HardwareToJSON(value["hardware"]),
        software:
            value["software"] == null
                ? undefined
                : (value["software"] as Array<any>).map(SoftwareToJSON),
        processes:
            value["processes"] == null
                ? undefined
                : (value["processes"] as Array<any>).map(ProcessToJSON),
        users:
            value["users"] == null
                ? undefined
                : (value["users"] as Array<any>).map(DeviceUserToJSON),
        groups:
            value["groups"] == null
                ? undefined
                : (value["groups"] as Array<any>).map(DeviceGroupToJSON),
        vendor: value["vendor"],
    };
}
