/* 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 { NetworkInterfaceRequest } from "./NetworkInterfaceRequest";
import {
    NetworkInterfaceRequestFromJSON,
    NetworkInterfaceRequestToJSON,
} from "./NetworkInterfaceRequest";

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

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

export function NetworkRequestFromJSON(json: any): NetworkRequest {
    return NetworkRequestFromJSONTyped(json, false);
}

export function NetworkRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): NetworkRequest {
    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(NetworkInterfaceRequestFromJSON),
        gateway: json["gateway"] == null ? undefined : json["gateway"],
    };
}

export function NetworkRequestToJSON(json: any): NetworkRequest {
    return NetworkRequestToJSONTyped(json, false);
}

export function NetworkRequestToJSONTyped(
    value?: NetworkRequest | 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(NetworkInterfaceRequestToJSON),
        gateway: value["gateway"],
    };
}
