/* tslint:disable */
/* eslint-disable */
/**
 * authentik
 * Making authentication simple.
 *
 * The version of the OpenAPI document: 2026.5.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 type { DeviceChallengeRequest } from "./DeviceChallengeRequest";
import {
    DeviceChallengeRequestFromJSON,
    DeviceChallengeRequestToJSON,
} from "./DeviceChallengeRequest";

/**
 * Challenge used for Code-based and WebAuthn authenticators
 * @export
 * @interface AuthenticatorValidationChallengeResponseRequest
 */
export interface AuthenticatorValidationChallengeResponseRequest {
    /**
     *
     * @type {string}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    component?: string;
    /**
     *
     * @type {DeviceChallengeRequest}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    selectedChallenge?: DeviceChallengeRequest;
    /**
     *
     * @type {string}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    selectedStage?: string;
    /**
     *
     * @type {string}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    code?: string;
    /**
     *
     * @type {{ [key: string]: any; }}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    webauthn?: { [key: string]: any };
    /**
     *
     * @type {number}
     * @memberof AuthenticatorValidationChallengeResponseRequest
     */
    duo?: number;
}

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

export function AuthenticatorValidationChallengeResponseRequestFromJSON(
    json: any,
): AuthenticatorValidationChallengeResponseRequest {
    return AuthenticatorValidationChallengeResponseRequestFromJSONTyped(json, false);
}

export function AuthenticatorValidationChallengeResponseRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): AuthenticatorValidationChallengeResponseRequest {
    if (json == null) {
        return json;
    }
    return {
        component: json["component"] == null ? undefined : json["component"],
        selectedChallenge:
            json["selected_challenge"] == null
                ? undefined
                : DeviceChallengeRequestFromJSON(json["selected_challenge"]),
        selectedStage: json["selected_stage"] == null ? undefined : json["selected_stage"],
        code: json["code"] == null ? undefined : json["code"],
        webauthn: json["webauthn"] == null ? undefined : json["webauthn"],
        duo: json["duo"] == null ? undefined : json["duo"],
    };
}

export function AuthenticatorValidationChallengeResponseRequestToJSON(
    json: any,
): AuthenticatorValidationChallengeResponseRequest {
    return AuthenticatorValidationChallengeResponseRequestToJSONTyped(json, false);
}

export function AuthenticatorValidationChallengeResponseRequestToJSONTyped(
    value?: AuthenticatorValidationChallengeResponseRequest | null,
    ignoreDiscriminator: boolean = false,
): any {
    if (value == null) {
        return value;
    }

    return {
        component: value["component"],
        selected_challenge: DeviceChallengeRequestToJSON(value["selectedChallenge"]),
        selected_stage: value["selectedStage"],
        code: value["code"],
        webauthn: value["webauthn"],
        duo: value["duo"],
    };
}
