e-ntfy-android/app/src/main/java/io/heckel/ntfy/msg/Message.kt

45 lines
1 KiB
Kotlin
Raw Normal View History

2022-01-15 18:40:38 -05:00
package io.heckel.ntfy.msg
import androidx.annotation.Keep
2022-04-16 20:12:40 -04:00
import io.heckel.ntfy.db.Action
2022-01-15 18:40:38 -05:00
/* This annotation ensures that proguard still works in production builds,
* see https://stackoverflow.com/a/62753300/1440785 */
@Keep
data class Message(
val id: String,
val time: Long,
val event: String,
val topic: String,
val priority: Int?,
val tags: List<String>?,
val click: String?,
2022-04-16 20:12:40 -04:00
val actions: List<MessageAction>?,
2022-01-15 18:40:38 -05:00
val title: String?,
val message: String,
val encoding: String?,
2022-01-15 18:40:38 -05:00
val attachment: MessageAttachment?,
)
@Keep
data class MessageAttachment(
val name: String,
val type: String?,
val size: Long?,
val expires: Long?,
val url: String,
)
2022-04-16 20:12:40 -04:00
@Keep
data class MessageAction(
2022-04-17 14:29:29 -04:00
val id: String,
2022-04-16 20:12:40 -04:00
val action: String,
val label: String,
2022-04-17 14:29:29 -04:00
val url: String?, // used in "view" and "http"
val method: String?, // used in "http"
val headers: Map<String,String>?, // used in "http"
val body: String?, // used in "http"
2022-04-16 20:12:40 -04:00
)
const val MESSAGE_ENCODING_BASE64 = "base64"