/* 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 { ContextualFlowInfo } from "./ContextualFlowInfo";
import { ContextualFlowInfoFromJSON, ContextualFlowInfoToJSON } from "./ContextualFlowInfo";
import type { ErrorDetail } from "./ErrorDetail";

/**
 * challenge type to render HTML as-is
 * @export
 * @interface ShellChallenge
 */
export interface ShellChallenge {
    /**
     *
     * @type {ContextualFlowInfo}
     * @memberof ShellChallenge
     */
    flowInfo?: ContextualFlowInfo;
    /**
     *
     * @type {string}
     * @memberof ShellChallenge
     */
    component?: string;
    /**
     *
     * @type {{ [key: string]: Array<ErrorDetail>; }}
     * @memberof ShellChallenge
     */
    responseErrors?: { [key: string]: Array<ErrorDetail> };
    /**
     *
     * @type {string}
     * @memberof ShellChallenge
     */
    body: string;
}

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

export function ShellChallengeFromJSON(json: any): ShellChallenge {
    return ShellChallengeFromJSONTyped(json, false);
}

export function ShellChallengeFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): ShellChallenge {
    if (json == null) {
        return json;
    }
    return {
        flowInfo:
            json["flow_info"] == null ? undefined : ContextualFlowInfoFromJSON(json["flow_info"]),
        component: json["component"] == null ? undefined : json["component"],
        responseErrors: json["response_errors"] == null ? undefined : json["response_errors"],
        body: json["body"],
    };
}

export function ShellChallengeToJSON(json: any): ShellChallenge {
    return ShellChallengeToJSONTyped(json, false);
}

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

    return {
        flow_info: ContextualFlowInfoToJSON(value["flowInfo"]),
        component: value["component"],
        response_errors: value["responseErrors"],
        body: value["body"],
    };
}
