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

/**
 *
 * @export
 * @interface TelegramAuthRequest
 */
export interface TelegramAuthRequest {
    /**
     *
     * @type {number}
     * @memberof TelegramAuthRequest
     */
    id: number;
    /**
     *
     * @type {string}
     * @memberof TelegramAuthRequest
     */
    firstName?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramAuthRequest
     */
    lastName?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramAuthRequest
     */
    username?: string;
    /**
     *
     * @type {string}
     * @memberof TelegramAuthRequest
     */
    photoUrl?: string;
    /**
     *
     * @type {number}
     * @memberof TelegramAuthRequest
     */
    authDate: number;
    /**
     *
     * @type {string}
     * @memberof TelegramAuthRequest
     */
    hash: string;
}

/**
 * Check if a given object implements the TelegramAuthRequest interface.
 */
export function instanceOfTelegramAuthRequest(value: object): value is TelegramAuthRequest {
    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 TelegramAuthRequestFromJSON(json: any): TelegramAuthRequest {
    return TelegramAuthRequestFromJSONTyped(json, false);
}

export function TelegramAuthRequestFromJSONTyped(
    json: any,
    ignoreDiscriminator: boolean,
): TelegramAuthRequest {
    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"],
    };
}

export function TelegramAuthRequestToJSON(json: any): TelegramAuthRequest {
    return TelegramAuthRequestToJSONTyped(json, false);
}

export function TelegramAuthRequestToJSONTyped(
    value?: TelegramAuthRequest | 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"],
    };
}
