/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2025.6.4
 * 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 { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * InvitationStage Serializer
 * @export
 * @interface InvitationStageRequest
 */
export interface InvitationStageRequest {
    /**
     * 
     * @type {string}
     * @memberof InvitationStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof InvitationStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 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 InvitationStageRequest
     */
    continueFlowWithoutInvitation?: boolean;
}

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

export function InvitationStageRequestFromJSON(json: any): InvitationStageRequest {
    return InvitationStageRequestFromJSONTyped(json, false);
}

export function InvitationStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): InvitationStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'continueFlowWithoutInvitation': json['continue_flow_without_invitation'] == null ? undefined : json['continue_flow_without_invitation'],
    };
}

export function InvitationStageRequestToJSON(json: any): InvitationStageRequest {
    return InvitationStageRequestToJSONTyped(json, false);
}

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

    return {
        
        'name': value['name'],
        'flow_set': value['flowSet'] == null ? undefined : ((value['flowSet'] as Array<any>).map(FlowSetRequestToJSON)),
        'continue_flow_without_invitation': value['continueFlowWithoutInvitation'],
    };
}

