Serializers Support

This commit is contained in:
shabinder 2021-06-06 00:50:39 +05:30
parent 6f5ce7fbe3
commit 934ed040af
7 changed files with 20 additions and 3 deletions

View File

@ -1,12 +1,15 @@
package models.github package models.github
import kotlinx.serialization.Serializable
@Serializable
data class Asset( data class Asset(
val browser_download_url: String, val browser_download_url: String,
val content_type: String, val content_type: String,
val created_at: String, val created_at: String,
val download_count: Int, val download_count: Int,
val id: Int, val id: Int,
val label: Any, // val label: Any,
val name: String, val name: String,
val node_id: String, val node_id: String,
val size: Int, val size: Int,

View File

@ -1,5 +1,8 @@
package models.github package models.github
import kotlinx.serialization.Serializable
@Serializable
data class Author( data class Author(
val avatar_url: String, val avatar_url: String,
val events_url: String, val events_url: String,

View File

@ -1,5 +1,8 @@
package models.github package models.github
import kotlinx.serialization.Serializable
@Serializable
data class GithubFileContent( data class GithubFileContent(
val decryptedContent: String, val decryptedContent: String,
val sha: String val sha: String

View File

@ -1,5 +1,8 @@
package models.github package models.github
import kotlinx.serialization.Serializable
@Serializable
data class GithubReleaseInfoItem( data class GithubReleaseInfoItem(
val assets: List<Asset>, val assets: List<Asset>,
val assets_url: String, val assets_url: String,
@ -13,7 +16,7 @@ data class GithubReleaseInfoItem(
val node_id: String, val node_id: String,
val prerelease: Boolean, val prerelease: Boolean,
val published_at: String, val published_at: String,
val reactions: Reactions, val reactions: Reactions? = null,
val tag_name: String, val tag_name: String,
val tarball_url: String, val tarball_url: String,
val target_commitish: String, val target_commitish: String,

View File

@ -1,3 +1,3 @@
package models.github package models.github
class GithubReleasesInfo : ArrayList<GithubReleaseInfoItem>() typealias GithubReleasesInfo = ArrayList<GithubReleaseInfoItem>

View File

@ -1,7 +1,9 @@
package models.github package models.github
import kotlinx.serialization.json.JsonNames import kotlinx.serialization.json.JsonNames
import kotlinx.serialization.Serializable
@Serializable
data class Reactions( data class Reactions(
@JsonNames("+1") val upVotes: Int = 0, @JsonNames("+1") val upVotes: Int = 0,
@JsonNames("-1") val downVotes: Int = 0, @JsonNames("-1") val downVotes: Int = 0,

View File

@ -1,5 +1,8 @@
package models.github package models.github
import kotlinx.serialization.Serializable
@Serializable
data class Uploader( data class Uploader(
val avatar_url: String, val avatar_url: String,
val events_url: String, val events_url: String,