/* 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";
import type { LogoutURL } from "./LogoutURL";
import { LogoutURLFromJSON, LogoutURLToJSON } from "./LogoutURL";

/**
 * Challenge for iframe logout
 * @export
 * @interface IframeLogoutChallenge
 */
export interface IframeLogoutChallenge {
    /**
     *
     * @type {ContextualFlowInfo}
     * @memberof IframeLogoutChallenge
     */
    flowInfo?: ContextualFlowInfo;
    /**
     *
     * @type {string}
     * @memberof IframeLogoutChallenge
     */
    component?: string;
    /**
     *
     * @type {{ [key: string]: Array<ErrorDetail>; }}
     * @memberof IframeLogoutChallenge
     */
    responseErrors?: { [key: string]: Array<ErrorDetail> };
    /**
     *
     * @type {Array<LogoutURL>}
     * @memberof IframeLogoutChallenge
     */
    logoutUrls?: Array<LogoutURL>;
}

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

export function IframeLogoutChallengeFromJSON(json: any): IframeLogoutChallenge {
    return IframeLogoutChallengeFromJSONTyped(json, false);
}

export function IframeLogoutChallengeFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): IframeLogoutChallenge {
    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"],
        logoutUrls:
            json["logout_urls"] == null
                ? undefined
                : (json["logout_urls"] as Array<any>).map(LogoutURLFromJSON),
    };
}

export function IframeLogoutChallengeToJSON(json: any): IframeLogoutChallenge {
    return IframeLogoutChallengeToJSONTyped(json, false);
}

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

    return {
        flow_info: ContextualFlowInfoToJSON(value["flowInfo"]),
        component: value["component"],
        response_errors: value["responseErrors"],
        logout_urls:
            value["logoutUrls"] == null
                ? undefined
                : (value["logoutUrls"] as Array<any>).map(LogoutURLToJSON),
    };
}
