package com.pixelized.biblib.network.data.response

import com.google.gson.annotations.SerializedName

data class UserResponse(
    @SerializedName("user")
    val data: Data? = null,
) : ErrorResponse() {
    data class Data(
        @SerializedName("id")
        val id: String? = null,
        @SerializedName("created")
        val created: String? = null,
        @SerializedName("updated")
        val updated: String? = null,
        @SerializedName("local")
        val local: Local? = null,
        @SerializedName("facebook")
        val facebook: Facebook? = null,
        @SerializedName("twitter")
        val twitter: Twitter? = null,
        @SerializedName("google")
        val google: Google? = null,
        @SerializedName("history")
        val history: History? = null,
    )

    data class Local(
        @SerializedName("username")
        val username: String? = null,
        @SerializedName("firstname")
        val firstname: String? = null,
        @SerializedName("lastname")
        val lastname: String? = null,
        @SerializedName("email")
        val email: String? = null,
        @SerializedName("isAdmin")
        val isAdmin: String? = null,
        @SerializedName("amazonEmails")
        val amazonEmails: List<String>? = null,
    )

    data class Facebook(
        @SerializedName("id")
        val id: String? = null,
        @SerializedName("email")
        val email: String? = null,
        @SerializedName("name")
        val name: String? = null,
    )

    data class Twitter(
        @SerializedName("id")
        val id: String? = null,
        @SerializedName("email")
        val email: String? = null,
        @SerializedName("name")
        val name: String? = null,
    )

    data class Google(
        @SerializedName("id")
        val id: String? = null,
        @SerializedName("email")
        val email: String? = null,
        @SerializedName("name")
        val name: String? = null,
    )

    data class History(
        @SerializedName("lastConnection")
        val lastConnection: String? = null,
        @SerializedName("downloadedBooks")
        val downloadedBooks: List<EBook>? = null,
        @SerializedName("ratings")
        val ratings: List<Rating>? = null,
    )

    data class EBook(
        @SerializedName("id")
        val id: Int? = null,
        @SerializedName("date")
        val date: String? = null,
        @SerializedName("data")
        val data: MetaEBook? = null,
    )

    data class MetaEBook(
        @SerializedName("data_id")
        val data_id: String? = null,
        @SerializedName("data_format")
        val data_format: String? = null,
        @SerializedName("data_size")
        val data_size: String? = null,
        @SerializedName("data_name")
        val data_name: String? = null,
    )

    data class Rating(
        @SerializedName("book_id")
        val book_id: Int? = null,
        @SerializedName("rating")
        val rating: Float? = null,
        @SerializedName("book_name")
        val book_name: String? = null,
        @SerializedName("date")
        val date: String? = null,
    )
}