/* 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 { DigitsEnum } from './DigitsEnum';
import {
    DigitsEnumFromJSON,
    DigitsEnumFromJSONTyped,
    DigitsEnumToJSON,
    DigitsEnumToJSONTyped,
} from './DigitsEnum';
import type { FlowSetRequest } from './FlowSetRequest';
import {
    FlowSetRequestFromJSON,
    FlowSetRequestFromJSONTyped,
    FlowSetRequestToJSON,
    FlowSetRequestToJSONTyped,
} from './FlowSetRequest';

/**
 * AuthenticatorTOTPStage Serializer
 * @export
 * @interface AuthenticatorTOTPStageRequest
 */
export interface AuthenticatorTOTPStageRequest {
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorTOTPStageRequest
     */
    name: string;
    /**
     * 
     * @type {Array<FlowSetRequest>}
     * @memberof AuthenticatorTOTPStageRequest
     */
    flowSet?: Array<FlowSetRequest>;
    /**
     * Flow used by an authenticated user to configure this Stage. If empty, user will not be able to configure this stage.
     * @type {string}
     * @memberof AuthenticatorTOTPStageRequest
     */
    configureFlow?: string | null;
    /**
     * 
     * @type {string}
     * @memberof AuthenticatorTOTPStageRequest
     */
    friendlyName?: string | null;
    /**
     * 
     * @type {DigitsEnum}
     * @memberof AuthenticatorTOTPStageRequest
     */
    digits: DigitsEnum;
}



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

export function AuthenticatorTOTPStageRequestFromJSON(json: any): AuthenticatorTOTPStageRequest {
    return AuthenticatorTOTPStageRequestFromJSONTyped(json, false);
}

export function AuthenticatorTOTPStageRequestFromJSONTyped(json: any, ignoreDiscriminator: boolean): AuthenticatorTOTPStageRequest {
    if (json == null) {
        return json;
    }
    return {
        
        'name': json['name'],
        'flowSet': json['flow_set'] == null ? undefined : ((json['flow_set'] as Array<any>).map(FlowSetRequestFromJSON)),
        'configureFlow': json['configure_flow'] == null ? undefined : json['configure_flow'],
        'friendlyName': json['friendly_name'] == null ? undefined : json['friendly_name'],
        'digits': DigitsEnumFromJSON(json['digits']),
    };
}

export function AuthenticatorTOTPStageRequestToJSON(json: any): AuthenticatorTOTPStageRequest {
    return AuthenticatorTOTPStageRequestToJSONTyped(json, false);
}

export function AuthenticatorTOTPStageRequestToJSONTyped(value?: AuthenticatorTOTPStageRequest | 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)),
        'configure_flow': value['configureFlow'],
        'friendly_name': value['friendlyName'],
        'digits': DigitsEnumToJSON(value['digits']),
    };
}

