/* 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 { UserVerificationEnum } from './UserVerificationEnum';
import {
    UserVerificationEnumFromJSON,
    UserVerificationEnumFromJSONTyped,
    UserVerificationEnumToJSON,
    UserVerificationEnumToJSONTyped,
} from './UserVerificationEnum';
import type { NotConfiguredActionEnum } from './NotConfiguredActionEnum';
import {
    NotConfiguredActionEnumFromJSON,
    NotConfiguredActionEnumFromJSONTyped,
    NotConfiguredActionEnumToJSON,
    NotConfiguredActionEnumToJSONTyped,
} from './NotConfiguredActionEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';
import type { DeviceClassesEnum } from './DeviceClassesEnum';
import {
    DeviceClassesEnumFromJSON,
    DeviceClassesEnumFromJSONTyped,
    DeviceClassesEnumToJSON,
    DeviceClassesEnumToJSONTyped,
} from './DeviceClassesEnum';

/**
 * AuthenticatorValidateStage Serializer
 * @export
 * @interface PatchedAuthenticatorValidateStageRequest
 */
export interface PatchedAuthenticatorValidateStageRequest {
    /**
     * 
     * @type {string}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    name?: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * 
     * @type {NotConfiguredActionEnum}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    notConfiguredAction?: NotConfiguredActionEnum;
    /**
     * Device classes which can be used to authenticate
     * @type {Array<DeviceClassesEnum>}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    deviceClasses?: Array<DeviceClassesEnum>;
    /**
     * Stages used to configure Authenticator when user doesn't have any compatible devices. After this configuration Stage passes, the user is not prompted again.
     * @type {Array<string>}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    configurationStages?: Array<string>;
    /**
     * If any of the user's device has been used within this threshold, this stage will be skipped
     * @type {string}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    lastAuthThreshold?: string;
    /**
     * Enforce user verification for WebAuthn devices.
     * @type {UserVerificationEnum}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    webauthnUserVerification?: UserVerificationEnum;
    /**
     * 
     * @type {Array<string>}
     * @memberof PatchedAuthenticatorValidateStageRequest
     */
    webauthnAllowedDeviceTypes?: Array<string>;
}



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

export function PatchedAuthenticatorValidateStageRequestFromJSON(json: any): PatchedAuthenticatorValidateStageRequest {
    return PatchedAuthenticatorValidateStageRequestFromJSONTyped(json, false);
}

export function PatchedAuthenticatorValidateStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): PatchedAuthenticatorValidateStageRequest {
    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)),
        'notConfiguredAction': json['not_configured_action'] == null ? undefined : NotConfiguredActionEnumFromJSON(json['not_configured_action']),
        'deviceClasses': json['device_classes'] == null ? undefined : ((json['device_classes'] as Array<any>).map(DeviceClassesEnumFromJSON)),
        'configurationStages': json['configuration_stages'] == null ? undefined : json['configuration_stages'],
        'lastAuthThreshold': json['last_auth_threshold'] == null ? undefined : json['last_auth_threshold'],
        'webauthnUserVerification': json['webauthn_user_verification'] == null ? undefined : UserVerificationEnumFromJSON(json['webauthn_user_verification']),
        'webauthnAllowedDeviceTypes': json['webauthn_allowed_device_types'] == null ? undefined : json['webauthn_allowed_device_types'],
    };
}

export function PatchedAuthenticatorValidateStageRequestToJSON(json: any): PatchedAuthenticatorValidateStageRequest {
    return PatchedAuthenticatorValidateStageRequestToJSONTyped(json, false);
}

export function PatchedAuthenticatorValidateStageRequestToJSONTyped(value?: PatchedAuthenticatorValidateStageRequest | 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)),
        'not_configured_action': NotConfiguredActionEnumToJSON(value['notConfiguredAction']),
        'device_classes': value['deviceClasses'] == null ? undefined : ((value['deviceClasses'] as Array<any>).map(DeviceClassesEnumToJSON)),
        'configuration_stages': value['configurationStages'],
        'last_auth_threshold': value['lastAuthThreshold'],
        'webauthn_user_verification': UserVerificationEnumToJSON(value['webauthnUserVerification']),
        'webauthn_allowed_device_types': value['webauthnAllowedDeviceTypes'],
    };
}

