/* 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 { FlowSet } from "./FlowSet";
import { FlowSetFromJSON } from "./FlowSet";

/**
 * InvitationStage Serializer
 * @export
 * @interface InvitationStage
 */
export interface InvitationStage {
    /**
     *
     * @type {string}
     * @memberof InvitationStage
     */
    readonly pk: string;
    /**
     *
     * @type {string}
     * @memberof InvitationStage
     */
    name: string;
    /**
     * Get object type so that we know how to edit the object
     * @type {string}
     * @memberof InvitationStage
     */
    readonly component: string;
    /**
     * Return object's verbose_name
     * @type {string}
     * @memberof InvitationStage
     */
    readonly verboseName: string;
    /**
     * Return object's plural verbose_name
     * @type {string}
     * @memberof InvitationStage
     */
    readonly verboseNamePlural: string;
    /**
     * Return internal model name
     * @type {string}
     * @memberof InvitationStage
     */
    readonly metaModelName: string;
    /**
     *
     * @type {Array<FlowSet>}
     * @memberof InvitationStage
     */
    readonly flowSet: Array<FlowSet>;
    /**
     * If this flag is set, this Stage will jump to the next Stage when no Invitation is given. By default this Stage will cancel the Flow when no invitation is given.
     * @type {boolean}
     * @memberof InvitationStage
     */
    continueFlowWithoutInvitation?: boolean;
}

/**
 * Check if a given object implements the InvitationStage interface.
 */
export function instanceOfInvitationStage(value: object): value is InvitationStage {
    if (!("pk" in value) || value["pk"] === undefined) return false;
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("component" in value) || value["component"] === undefined) return false;
    if (!("verboseName" in value) || value["verboseName"] === undefined) return false;
    if (!("verboseNamePlural" in value) || value["verboseNamePlural"] === undefined) return false;
    if (!("metaModelName" in value) || value["metaModelName"] === undefined) return false;
    if (!("flowSet" in value) || value["flowSet"] === undefined) return false;
    return true;
}

export function InvitationStageFromJSON(json: any): InvitationStage {
    return InvitationStageFromJSONTyped(json, false);
}

export function InvitationStageFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): InvitationStage {
    if (json == null) {
        return json;
    }
    return {
        pk: json["pk"],
        name: json["name"],
        component: json["component"],
        verboseName: json["verbose_name"],
        verboseNamePlural: json["verbose_name_plural"],
        metaModelName: json["meta_model_name"],
        flowSet: (json["flow_set"] as Array<any>).map(FlowSetFromJSON),
        continueFlowWithoutInvitation:
            json["continue_flow_without_invitation"] == null
                ? undefined
                : json["continue_flow_without_invitation"],
    };
}

export function InvitationStageToJSON(json: any): InvitationStage {
    return InvitationStageToJSONTyped(json, false);
}

export function InvitationStageToJSONTyped(
    value?: Omit<
        InvitationStage,
        "pk" | "component" | "verbose_name" | "verbose_name_plural" | "meta_model_name" | "flow_set"
    > | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        name: value["name"],
        continue_flow_without_invitation: value["continueFlowWithoutInvitation"],
    };
}
