All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.river.connector.github.model.TreeRef.kt Maven / Gradle / Ivy

There is a newer version: 1.0.0-alpha18
Show newest version
package com.river.connector.github.model

import com.fasterxml.jackson.annotation.JsonSubTypes
import com.fasterxml.jackson.annotation.JsonTypeInfo

data class TreeRef(
    val sha: String,
    val url: String,
    val tree: List
) {
    @JsonTypeInfo(
        use = JsonTypeInfo.Id.NAME,
        include = JsonTypeInfo.As.PROPERTY,
        property = "type"
    )
    @JsonSubTypes(
        JsonSubTypes.Type(value = TreeEntry.Tree::class, name = "tree"),
        JsonSubTypes.Type(value = TreeEntry.Blob::class, name = "blob")
    )
    sealed interface TreeEntry {
        val path: String
        val mode: String
        val sha: String
        val url: String

        data class Tree(
            override val path: String,
            override val mode: String,
            override val sha: String,
            override val url: String,
        ) : TreeEntry

        data class Blob(
            override val path: String,
            override val mode: String,
            override val sha: String,
            override val url: String,
            val size: Long
        ) : TreeEntry
    }
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy