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

/**
 * IdentificationStage Serializer
 * @export
 * @interface PatchedIdentificationStageRequest
 */
export interface PatchedIdentificationStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedIdentificationStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * Fields of the user object to match against. (Hold shift to select multiple options)
     * @type {Array<UserFieldsEnum>}
     * @memberof PatchedIdentificationStageRequest
     */
    userFields?: Array<UserFieldsEnum>;
    /**
     * When set, shows a password field, instead of showing the password field as separate step.
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    passwordStage?: string | null;
    /**
     * When set, adds functionality exactly like a Captcha stage, but baked into the Identification stage.
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    captchaStage?: string | null;
    /**
     * When enabled, user fields are matched regardless of their casing.
     * @type {boolean}
     * @memberof PatchedIdentificationStageRequest
     */
    caseInsensitiveMatching?: boolean;
    /**
     * When a valid username/email has been entered, and this option is enabled, the user's username and avatar will be shown. Otherwise, the text that the user entered will be shown
     * @type {boolean}
     * @memberof PatchedIdentificationStageRequest
     */
    showMatchedUser?: boolean;
    /**
     * Optional enrollment flow, which is linked at the bottom of the page.
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    enrollmentFlow?: string | null;
    /**
     * Optional recovery flow, which is linked at the bottom of the page.
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    recoveryFlow?: string | null;
    /**
     * Optional passwordless flow, which is linked at the bottom of the page.
     * @type {string}
     * @memberof PatchedIdentificationStageRequest
     */
    passwordlessFlow?: string | null;
    /**
     * Specify which sources should be shown.
     * @type {Array<string>}
     * @memberof PatchedIdentificationStageRequest
     */
    sources?: Array<string>;
    /**
     * 
     * @type {boolean}
     * @memberof PatchedIdentificationStageRequest
     */
    showSourceLabels?: boolean;
    /**
     * When enabled, the stage will succeed and continue even when incorrect user info is entered.
     * @type {boolean}
     * @memberof PatchedIdentificationStageRequest
     */
    pretendUserExists?: boolean;
    /**
     * Show the user the 'Remember me on this device' toggle, allowing repeat users to skip straight to entering their password.
     * @type {boolean}
     * @memberof PatchedIdentificationStageRequest
     */
    enableRememberMe?: boolean;
}

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

export function PatchedIdentificationStageRequestFromJSON(json: any): PatchedIdentificationStageRequest {
    return PatchedIdentificationStageRequestFromJSONTyped(json, false);
}

export function PatchedIdentificationStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedIdentificationStageRequest {
    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)),
        'userFields': json['user_fields'] == null ? undefined : ((json['user_fields'] as Array<any>).map(UserFieldsEnumFromJSON)),
        'passwordStage': json['password_stage'] == null ? undefined : json['password_stage'],
        'captchaStage': json['captcha_stage'] == null ? undefined : json['captcha_stage'],
        'caseInsensitiveMatching': json['case_insensitive_matching'] == null ? undefined : json['case_insensitive_matching'],
        'showMatchedUser': json['show_matched_user'] == null ? undefined : json['show_matched_user'],
        'enrollmentFlow': json['enrollment_flow'] == null ? undefined : json['enrollment_flow'],
        'recoveryFlow': json['recovery_flow'] == null ? undefined : json['recovery_flow'],
        'passwordlessFlow': json['passwordless_flow'] == null ? undefined : json['passwordless_flow'],
        'sources': json['sources'] == null ? undefined : json['sources'],
        'showSourceLabels': json['show_source_labels'] == null ? undefined : json['show_source_labels'],
        'pretendUserExists': json['pretend_user_exists'] == null ? undefined : json['pretend_user_exists'],
        'enableRememberMe': json['enable_remember_me'] == null ? undefined : json['enable_remember_me'],
    };
}

export function PatchedIdentificationStageRequestToJSON(json: any): PatchedIdentificationStageRequest {
    return PatchedIdentificationStageRequestToJSONTyped(json, false);
}

export function PatchedIdentificationStageRequestToJSONTyped(value?: PatchedIdentificationStageRequest | 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)),
        'user_fields': value['userFields'] == null ? undefined : ((value['userFields'] as Array<any>).map(UserFieldsEnumToJSON)),
        'password_stage': value['passwordStage'],
        'captcha_stage': value['captchaStage'],
        'case_insensitive_matching': value['caseInsensitiveMatching'],
        'show_matched_user': value['showMatchedUser'],
        'enrollment_flow': value['enrollmentFlow'],
        'recovery_flow': value['recoveryFlow'],
        'passwordless_flow': value['passwordlessFlow'],
        'sources': value['sources'],
        'show_source_labels': value['showSourceLabels'],
        'pretend_user_exists': value['pretendUserExists'],
        'enable_remember_me': value['enableRememberMe'],
    };
}

