/* 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';
import type { RedirectStageModeEnum } from './RedirectStageModeEnum';
import {
    RedirectStageModeEnumFromJSON,
    RedirectStageModeEnumFromJSONTyped,
    RedirectStageModeEnumToJSON,
    RedirectStageModeEnumToJSONTyped,
} from './RedirectStageModeEnum';

/**
 * RedirectStage Serializer
 * @export
 * @interface PatchedRedirectStageRequest
 */
export interface PatchedRedirectStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedRedirectStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedRedirectStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedRedirectStageRequest
     */
    keepContext?: boolean;
    /**
     * 
     * @type {RedirectStageModeEnum}
     * @memberof PatchedRedirectStageRequest
     */
    mode?: RedirectStageModeEnum;
    /**
     * 
     * @type {string}
     * @memberof PatchedRedirectStageRequest
     */
    targetStatic?: string;
    /**
     * 
     * @type {string}
     * @memberof PatchedRedirectStageRequest
     */
    targetFlow?: string | null;
}



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

export function PatchedRedirectStageRequestFromJSON(json: any): PatchedRedirectStageRequest {
    return PatchedRedirectStageRequestFromJSONTyped(json, false);
}

export function PatchedRedirectStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedRedirectStageRequest {
    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)),
        'keepContext': json['keep_context'] == null ? undefined : json['keep_context'],
        'mode': json['mode'] == null ? undefined : RedirectStageModeEnumFromJSON(json['mode']),
        'targetStatic': json['target_static'] == null ? undefined : json['target_static'],
        'targetFlow': json['target_flow'] == null ? undefined : json['target_flow'],
    };
}

export function PatchedRedirectStageRequestToJSON(json: any): PatchedRedirectStageRequest {
    return PatchedRedirectStageRequestToJSONTyped(json, false);
}

export function PatchedRedirectStageRequestToJSONTyped(value?: PatchedRedirectStageRequest | 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)),
        'keep_context': value['keepContext'],
        'mode': RedirectStageModeEnumToJSON(value['mode']),
        'target_static': value['targetStatic'],
        'target_flow': value['targetFlow'],
    };
}

