/* 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.
 */

/**
 * CaptchaStage Serializer
 * @export
 * @interface CaptchaStageRequest
 */
export interface CaptchaStageRequest {
    /**
     *
     * @type {string}
     * @memberof CaptchaStageRequest
     */
    name: string;
    /**
     * Public key, acquired your captcha Provider.
     * @type {string}
     * @memberof CaptchaStageRequest
     */
    publicKey: string;
    /**
     * Private key, acquired your captcha Provider.
     * @type {string}
     * @memberof CaptchaStageRequest
     */
    privateKey: string;
    /**
     *
     * @type {string}
     * @memberof CaptchaStageRequest
     */
    jsUrl?: string;
    /**
     *
     * @type {string}
     * @memberof CaptchaStageRequest
     */
    apiUrl?: string;
    /**
     *
     * @type {boolean}
     * @memberof CaptchaStageRequest
     */
    interactive?: boolean;
    /**
     *
     * @type {number}
     * @memberof CaptchaStageRequest
     */
    scoreMinThreshold?: number;
    /**
     *
     * @type {number}
     * @memberof CaptchaStageRequest
     */
    scoreMaxThreshold?: number;
    /**
     * When enabled and the received captcha score is outside of the given threshold, the stage will show an error message. When not enabled, the flow will continue, but the data from the captcha will be available in the context for policy decisions
     * @type {boolean}
     * @memberof CaptchaStageRequest
     */
    errorOnInvalidScore?: boolean;
}

/**
 * Check if a given object implements the CaptchaStageRequest interface.
 */
export function instanceOfCaptchaStageRequest(value: object): value is CaptchaStageRequest {
    if (!("name" in value) || value["name"] === undefined) return false;
    if (!("publicKey" in value) || value["publicKey"] === undefined) return false;
    if (!("privateKey" in value) || value["privateKey"] === undefined) return false;
    return true;
}

export function CaptchaStageRequestFromJSON(json: any): CaptchaStageRequest {
    return CaptchaStageRequestFromJSONTyped(json, false);
}

export function CaptchaStageRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): CaptchaStageRequest {
    if (json == null) {
        return json;
    }
    return {
        name: json["name"],
        publicKey: json["public_key"],
        privateKey: json["private_key"],
        jsUrl: json["js_url"] == null ? undefined : json["js_url"],
        apiUrl: json["api_url"] == null ? undefined : json["api_url"],
        interactive: json["interactive"] == null ? undefined : json["interactive"],
        scoreMinThreshold:
            json["score_min_threshold"] == null ? undefined : json["score_min_threshold"],
        scoreMaxThreshold:
            json["score_max_threshold"] == null ? undefined : json["score_max_threshold"],
        errorOnInvalidScore:
            json["error_on_invalid_score"] == null ? undefined : json["error_on_invalid_score"],
    };
}

export function CaptchaStageRequestToJSON(json: any): CaptchaStageRequest {
    return CaptchaStageRequestToJSONTyped(json, false);
}

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

    return {
        name: value["name"],
        public_key: value["publicKey"],
        private_key: value["privateKey"],
        js_url: value["jsUrl"],
        api_url: value["apiUrl"],
        interactive: value["interactive"],
        score_min_threshold: value["scoreMinThreshold"],
        score_max_threshold: value["scoreMaxThreshold"],
        error_on_invalid_score: value["errorOnInvalidScore"],
    };
}
