/* 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 { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

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

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

export function PatchedInvitationStageRequestFromJSON(json: any): PatchedInvitationStageRequest {
    return PatchedInvitationStageRequestFromJSONTyped(json, false);
}

export function PatchedInvitationStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedInvitationStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'] == null ? undefined : 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 PatchedInvitationStageRequestToJSON(json: any): PatchedInvitationStageRequest {
    return PatchedInvitationStageRequestToJSONTyped(json, false);
}

export function PatchedInvitationStageRequestToJSONTyped(value?: PatchedInvitationStageRequest | 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'],
    };
}

