/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.10.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 { mapValues } from '../runtime';
import type { ErrorDetail } from './ErrorDetail';
import {
    ErrorDetailFromJSON,
    ErrorDetailFromJSONTyped,
    ErrorDetailToJSON,
    ErrorDetailToJSONTyped,
} from './ErrorDetail';
import type { ContextualFlowInfo } from './ContextualFlowInfo';
import {
    ContextualFlowInfoFromJSON,
    ContextualFlowInfoFromJSONTyped,
    ContextualFlowInfoToJSON,
    ContextualFlowInfoToJSONTyped,
} from './ContextualFlowInfo';

/**
 * Challenge type to render a frame
 * @export
 * @interface FrameChallenge
 */
export interface FrameChallenge {
    /**
     * 
     * @type {ContextualFlowInfo}
     * @memberof FrameChallenge
     */
    flowInfo?: ContextualFlowInfo;
    /**
     * 
     * @type {string}
     * @memberof FrameChallenge
     */
    component?: string;
    /**
     * 
     * @type {{ [key: string]: Array<ErrorDetail>; }}
     * @memberof FrameChallenge
     */
    responseErrors?: { [key: string]: Array<ErrorDetail>; };
    /**
     * 
     * @type {string}
     * @memberof FrameChallenge
     */
    url: string;
    /**
     * 
     * @type {boolean}
     * @memberof FrameChallenge
     */
    loadingOverlay?: boolean;
    /**
     * 
     * @type {string}
     * @memberof FrameChallenge
     */
    loadingText: string;
}

/**
 * Check if a given object implements the FrameChallenge interface.
 */
export function instanceOfFrameChallenge(value: object): value is FrameChallenge {
    if (!('url' in value) || value['url'] === undefined) return false;
    if (!('loadingText' in value) || value['loadingText'] === undefined) return false;
    return true;
}

export function FrameChallengeFromJSON(json: any): FrameChallenge {
    return FrameChallengeFromJSONTyped(json, false);
}

export function FrameChallengeFromJSONTyped(json: any, ignoreDiscriminator: boolean): FrameChallenge {
    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'],
        'url': json['url'],
        'loadingOverlay': json['loading_overlay'] == null ? undefined : json['loading_overlay'],
        'loadingText': json['loading_text'],
    };
}

export function FrameChallengeToJSON(json: any): FrameChallenge {
    return FrameChallengeToJSONTyped(json, false);
}

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

    return {
        
        'flow_info': ContextualFlowInfoToJSON(value['flowInfo']),
        'component': value['component'],
        'response_errors': value['responseErrors'],
        'url': value['url'],
        'loading_overlay': value['loadingOverlay'],
        'loading_text': value['loadingText'],
    };
}

