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