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

/**
 * Base class for all challenge responses
 * @export
 * @interface TelegramChallengeResponseRequest
 */
export interface TelegramChallengeResponseRequest {
    /**
     *
     * @type {number}
     * @memberof TelegramChallengeResponseRequest
     */
    id: number;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    firstName?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    lastName?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    username?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    photoUrl?: string;
    /**
     *
     * @type {number}
     * @memberof TelegramChallengeResponseRequest
     */
    authDate: number;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    hash: string;
    /**
     *
     * @type {string}
     * @memberof TelegramChallengeResponseRequest
     */
    component?: string;
}

/**
 * Check if a given object implements the TelegramChallengeResponseRequest interface.
 */
export function instanceOfTelegramChallengeResponseRequest(
    value: object,
): value is TelegramChallengeResponseRequest {
    if (!("id" in value) || value["id"] === undefined) return false;
    if (!("authDate" in value) || value["authDate"] === undefined) return false;
    if (!("hash" in value) || value["hash"] === undefined) return false;
    return true;
}

export function TelegramChallengeResponseRequestFromJSON(
    json: any,
): TelegramChallengeResponseRequest {
    return TelegramChallengeResponseRequestFromJSONTyped(json, false);
}

export function TelegramChallengeResponseRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): TelegramChallengeResponseRequest {
    if (json == null) {
        return json;
    }
    return {
        id: json["id"],
        firstName: json["first_name"] == null ? undefined : json["first_name"],
        lastName: json["last_name"] == null ? undefined : json["last_name"],
        username: json["username"] == null ? undefined : json["username"],
        photoUrl: json["photo_url"] == null ? undefined : json["photo_url"],
        authDate: json["auth_date"],
        hash: json["hash"],
        component: json["component"] == null ? undefined : json["component"],
    };
}

export function TelegramChallengeResponseRequestToJSON(
    json: any,
): TelegramChallengeResponseRequest {
    return TelegramChallengeResponseRequestToJSONTyped(json, false);
}

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

    return {
        id: value["id"],
        first_name: value["firstName"],
        last_name: value["lastName"],
        username: value["username"],
        photo_url: value["photoUrl"],
        auth_date: value["authDate"],
        hash: value["hash"],
        component: value["component"],
    };
}
