git.iko.soy/opencode-android
on 0bc1eda help sign in
34 lines 905 B history raw
1package soy.iko.opencode.data.model
3import kotlinx.serialization.Serializable
5/** Entry from `GET /file?path=` (directory listing). */
6@Serializable
7data class FileNode(
8 val name: String = "",
9 val path: String = "",
10 val type: String? = null,
11) {
12 val isDirectory: Boolean get() = type == "directory"
15/** Response of `GET /file/content?path=`. */
16@Serializable
17data class FileContent(
18 val type: String? = null, // "text" | "binary"
19 val content: String = "",
20 val diff: String? = null,
21 val mimeType: String? = null,
22 val encoding: String? = null,
23) {
24 val isBinary: Boolean get() = type == "binary" || encoding == "base64"
27/** Entry from `GET /file/status` (VCS status). */
28@Serializable
29data class FileStatusEntry(
30 val path: String = "",
31 val added: Int = 0,
32 val removed: Int = 0,
33 val status: String? = null, // "added" | "deleted" | "modified"