/* 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 { ContextualFlowInfoLayoutEnum } from "./ContextualFlowInfoLayoutEnum";
import {
    ContextualFlowInfoLayoutEnumFromJSON,
    ContextualFlowInfoLayoutEnumToJSON,
} from "./ContextualFlowInfoLayoutEnum";
import type { ThemedUrls } from "./ThemedUrls";
import { ThemedUrlsFromJSON, ThemedUrlsToJSON } from "./ThemedUrls";

/**
 * Contextual flow information for a challenge
 * @export
 * @interface ContextualFlowInfo
 */
export interface ContextualFlowInfo {
    /**
     *
     * @type {string}
     * @memberof ContextualFlowInfo
     */
    title?: string;
    /**
     *
     * @type {string}
     * @memberof ContextualFlowInfo
     */
    background?: string;
    /**
     *
     * @type {ThemedUrls}
     * @memberof ContextualFlowInfo
     */
    backgroundThemedUrls?: ThemedUrls | null;
    /**
     *
     * @type {string}
     * @memberof ContextualFlowInfo
     */
    cancelUrl: string;
    /**
     *
     * @type {ContextualFlowInfoLayoutEnum}
     * @memberof ContextualFlowInfo
     */
    layout: ContextualFlowInfoLayoutEnum;
}

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

export function ContextualFlowInfoFromJSON(json: any): ContextualFlowInfo {
    return ContextualFlowInfoFromJSONTyped(json, false);
}

export function ContextualFlowInfoFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): ContextualFlowInfo {
    if (json == null) {
        return json;
    }
    return {
        title: json["title"] == null ? undefined : json["title"],
        background: json["background"] == null ? undefined : json["background"],
        backgroundThemedUrls:
            json["background_themed_urls"] == null
                ? undefined
                : ThemedUrlsFromJSON(json["background_themed_urls"]),
        cancelUrl: json["cancel_url"],
        layout: ContextualFlowInfoLayoutEnumFromJSON(json["layout"]),
    };
}

export function ContextualFlowInfoToJSON(json: any): ContextualFlowInfo {
    return ContextualFlowInfoToJSONTyped(json, false);
}

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

    return {
        title: value["title"],
        background: value["background"],
        background_themed_urls: ThemedUrlsToJSON(value["backgroundThemedUrls"]),
        cancel_url: value["cancelUrl"],
        layout: ContextualFlowInfoLayoutEnumToJSON(value["layout"]),
    };
}
