/* 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 { NetworkInterface } from "./NetworkInterface";
import { NetworkInterfaceFromJSON, NetworkInterfaceToJSON } from "./NetworkInterface";

/**
 *
 * @export
 * @interface Network
 */
export interface Network {
    /**
     *
     * @type {string}
     * @memberof Network
     */
    hostname: string;
    /**
     *
     * @type {boolean}
     * @memberof Network
     */
    firewallEnabled?: boolean;
    /**
     *
     * @type {Array<NetworkInterface>}
     * @memberof Network
     */
    interfaces: Array<NetworkInterface>;
    /**
     *
     * @type {string}
     * @memberof Network
     */
    gateway?: string;
}

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

export function NetworkFromJSON(json: any): Network {
    return NetworkFromJSONTyped(json, false);
}

export function NetworkFromJSONTyped(json: any, ignoreDiscriminator: boolean): Network {
    if (json == null) {
        return json;
    }
    return {
        hostname: json["hostname"],
        firewallEnabled: json["firewall_enabled"] == null ? undefined : json["firewall_enabled"],
        interfaces: (json["interfaces"] as Array<any>).map(NetworkInterfaceFromJSON),
        gateway: json["gateway"] == null ? undefined : json["gateway"],
    };
}

export function NetworkToJSON(json: any): Network {
    return NetworkToJSONTyped(json, false);
}

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

    return {
        hostname: value["hostname"],
        firewall_enabled: value["firewallEnabled"],
        interfaces: (value["interfaces"] as Array<any>).map(NetworkInterfaceToJSON),
        gateway: value["gateway"],
    };
}
