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