git.iko.soy/opencode-android
on d643c13 help sign in
21 lines 604 B history raw
1package soy.iko.opencode.data.model
3import androidx.compose.runtime.Immutable
5/**
6 * A saved opencode server connection. The [password] for HTTP Basic auth is resolved
7 * separately from EncryptedSharedPreferences and is null when not loaded/needed.
8 */
9@Immutable
10data class ServerProfile(
11 val id: String,
12 val label: String,
13 val baseUrl: String,
14 val username: String? = null,
15 val password: String? = null,
16 val lastUsed: Long = 0,
17) {
18 val hasAuth: Boolean get() = !username.isNullOrBlank()
20 val displayLabel: String get() = label.takeIf { it.isNotBlank() } ?: baseUrl