mirror of
https://github.com/InsanusMokrassar/SauceNaoAPI.git
synced 2024-11-04 22:33:47 +00:00
update models for better work with new libraries
This commit is contained in:
parent
671af0517b
commit
653967129a
@ -7,8 +7,6 @@ import kotlinx.serialization.json.*
|
||||
|
||||
@Serializable
|
||||
data class Header(
|
||||
@SerialName("user_id")
|
||||
val userId: Int,
|
||||
@SerialName("account_type")
|
||||
val accountType: String,
|
||||
@SerialName("short_limit")
|
||||
@ -35,7 +33,9 @@ data class Header(
|
||||
@SerialName("query_image")
|
||||
val queryImage: String, // something like "uuid.jpg"
|
||||
@SerialName("results_returned")
|
||||
val resultsCount: Int
|
||||
val resultsCount: Int,
|
||||
@SerialName("user_id")
|
||||
val userId: Int? = null
|
||||
)
|
||||
|
||||
object IndexesSerializer : KSerializer<List<HeaderIndex?>> {
|
||||
|
@ -1,14 +1,11 @@
|
||||
package com.github.insanusmokrassar.SauceNaoAPI.models
|
||||
|
||||
import kotlinx.serialization.Optional
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Serializable
|
||||
data class HeaderIndex(
|
||||
val status: Int,
|
||||
val id: Int,
|
||||
@Optional
|
||||
val results: Int = 0,
|
||||
@Optional
|
||||
val parent_id: Int? = null
|
||||
)
|
||||
|
@ -2,48 +2,35 @@ package com.github.insanusmokrassar.SauceNaoAPI.models
|
||||
|
||||
import com.github.insanusmokrassar.SauceNaoAPI.utils.CommonMultivariantStringSerializer
|
||||
import kotlinx.serialization.*
|
||||
import kotlinx.serialization.internal.ArrayListSerializer
|
||||
import kotlinx.serialization.internal.StringSerializer
|
||||
|
||||
@Serializable
|
||||
data class ResultData(
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("danbooru_id")
|
||||
@Optional
|
||||
val danbooruId: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("gelbooru_id")
|
||||
@Optional
|
||||
val gelbooruId: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("drawr_id")
|
||||
@Optional
|
||||
val drawrId: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("pixiv_id")
|
||||
@Optional
|
||||
val pixivId: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@Optional
|
||||
val title: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@Optional
|
||||
val creator: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@Optional
|
||||
val material: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("member_name")
|
||||
@Optional
|
||||
val memberName: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@SerialName("member_id")
|
||||
@Optional
|
||||
val memberId: String? = null,
|
||||
@Serializable(CommonMultivariantStringSerializer::class)
|
||||
@Optional
|
||||
val characters: String? = null,
|
||||
@SerialName("ext_urls")
|
||||
@Optional
|
||||
val extUrls: List<String> = emptyList()
|
||||
)
|
||||
|
Loading…
Reference in New Issue
Block a user