mirror of
https://github.com/binwiederhier/ntfy-android.git
synced 2024-05-21 04:52:32 +12:00
48 lines
1.3 KiB
Kotlin
48 lines
1.3 KiB
Kotlin
package io.heckel.ntfy.msg
|
|
|
|
import androidx.annotation.Keep
|
|
|
|
/* 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?,
|
|
val icon: String?,
|
|
val actions: List<MessageAction>?,
|
|
val title: String?,
|
|
val message: String,
|
|
val encoding: String?,
|
|
val attachment: MessageAttachment?,
|
|
)
|
|
|
|
@Keep
|
|
data class MessageAttachment(
|
|
val name: String,
|
|
val type: String?,
|
|
val size: Long?,
|
|
val expires: Long?,
|
|
val url: String,
|
|
)
|
|
|
|
@Keep
|
|
data class MessageAction(
|
|
val id: String,
|
|
val action: String,
|
|
val label: String, // "view", "broadcast" or "http"
|
|
val clear: Boolean?, // clear notification after successful execution
|
|
val url: String?, // used in "view" and "http" actions
|
|
val method: String?, // used in "http" action, default is POST (!)
|
|
val headers: Map<String,String>?, // used in "http" action
|
|
val body: String?, // used in "http" action
|
|
val intent: String?, // used in "broadcast" action
|
|
val extras: Map<String,String>?, // used in "broadcast" action
|
|
)
|
|
|
|
const val MESSAGE_ENCODING_BASE64 = "base64"
|