/* 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 { AuthenticationEnum } from "./AuthenticationEnum";
import { AuthenticationEnumFromJSON, AuthenticationEnumToJSON } from "./AuthenticationEnum";
import type { DeniedActionEnum } from "./DeniedActionEnum";
import { DeniedActionEnumFromJSON, DeniedActionEnumToJSON } from "./DeniedActionEnum";
import type { FlowDesignationEnum } from "./FlowDesignationEnum";
import { FlowDesignationEnumFromJSON, FlowDesignationEnumToJSON } from "./FlowDesignationEnum";
import type { FlowLayoutEnum } from "./FlowLayoutEnum";
import { FlowLayoutEnumFromJSON, FlowLayoutEnumToJSON } from "./FlowLayoutEnum";
import type { PolicyEngineMode } from "./PolicyEngineMode";
import { PolicyEngineModeFromJSON, PolicyEngineModeToJSON } from "./PolicyEngineMode";

/**
 * Flow Serializer
 * @export
 * @interface PatchedFlowRequest
 */
export interface PatchedFlowRequest {
    /**
     *
     * @type {string}
     * @memberof PatchedFlowRequest
     */
    name?: string;
    /**
     * Visible in the URL.
     * @type {string}
     * @memberof PatchedFlowRequest
     */
    slug?: string;
    /**
     * Shown as the Title in Flow pages.
     * @type {string}
     * @memberof PatchedFlowRequest
     */
    title?: string;
    /**
     * Decides what this Flow is used for. For example, the Authentication flow is redirect to when an un-authenticated user visits authentik.
     * @type {FlowDesignationEnum}
     * @memberof PatchedFlowRequest
     */
    designation?: FlowDesignationEnum;
    /**
     * Background shown during execution
     * @type {string}
     * @memberof PatchedFlowRequest
     */
    background?: string;
    /**
     *
     * @type {PolicyEngineMode}
     * @memberof PatchedFlowRequest
     */
    policyEngineMode?: PolicyEngineMode;
    /**
     * Enable compatibility mode, increases compatibility with password managers on mobile devices.
     * @type {boolean}
     * @memberof PatchedFlowRequest
     */
    compatibilityMode?: boolean;
    /**
     *
     * @type {FlowLayoutEnum}
     * @memberof PatchedFlowRequest
     */
    layout?: FlowLayoutEnum;
    /**
     * Configure what should happen when a flow denies access to a user.
     * @type {DeniedActionEnum}
     * @memberof PatchedFlowRequest
     */
    deniedAction?: DeniedActionEnum;
    /**
     * Required level of authentication and authorization to access a flow.
     * @type {AuthenticationEnum}
     * @memberof PatchedFlowRequest
     */
    authentication?: AuthenticationEnum;
}

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

export function PatchedFlowRequestFromJSON(json: any): PatchedFlowRequest {
    return PatchedFlowRequestFromJSONTyped(json, false);
}

export function PatchedFlowRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): PatchedFlowRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"] == null ? undefined : json["name"],
        slug: json["slug"] == null ? undefined : json["slug"],
        title: json["title"] == null ? undefined : json["title"],
        designation:
            json["designation"] == null
                ? undefined
                : FlowDesignationEnumFromJSON(json["designation"]),
        background: json["background"] == null ? undefined : json["background"],
        policyEngineMode:
            json["policy_engine_mode"] == null
                ? undefined
                : PolicyEngineModeFromJSON(json["policy_engine_mode"]),
        compatibilityMode:
            json["compatibility_mode"] == null ? undefined : json["compatibility_mode"],
        layout: json["layout"] == null ? undefined : FlowLayoutEnumFromJSON(json["layout"]),
        deniedAction:
            json["denied_action"] == null
                ? undefined
                : DeniedActionEnumFromJSON(json["denied_action"]),
        authentication:
            json["authentication"] == null
                ? undefined
                : AuthenticationEnumFromJSON(json["authentication"]),
    };
}

export function PatchedFlowRequestToJSON(json: any): PatchedFlowRequest {
    return PatchedFlowRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        slug: value["slug"],
        title: value["title"],
        designation: FlowDesignationEnumToJSON(value["designation"]),
        background: value["background"],
        policy_engine_mode: PolicyEngineModeToJSON(value["policyEngineMode"]),
        compatibility_mode: value["compatibilityMode"],
        layout: FlowLayoutEnumToJSON(value["layout"]),
        denied_action: DeniedActionEnumToJSON(value["deniedAction"]),
        authentication: AuthenticationEnumToJSON(value["authentication"]),
    };
}
