commonMain.cache.data.ActivityData.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of kord-core Show documentation
Show all versions of kord-core Show documentation
Idiomatic Kotlin Wrapper for The Discord API
package dev.kord.core.cache.data
import dev.kord.common.entity.*
import dev.kord.common.entity.optional.Optional
import dev.kord.common.entity.optional.OptionalBoolean
import dev.kord.common.entity.optional.OptionalSnowflake
import dev.kord.common.serialization.InstantInEpochMilliseconds
import kotlinx.serialization.Serializable
@Serializable
public data class ActivityData(
val name: String,
val type: ActivityType,
val url: Optional = Optional.Missing(),
val createdAt: InstantInEpochMilliseconds,
val timestamps: Optional = Optional.Missing(),
val applicationId: OptionalSnowflake = OptionalSnowflake.Missing,
val details: Optional = Optional.Missing(),
val state: Optional = Optional.Missing(),
val emoji: Optional = Optional.Missing(),
val party: Optional = Optional.Missing(),
val assets: Optional = Optional.Missing(),
val secrets: Optional = Optional.Missing(),
val instance: OptionalBoolean = OptionalBoolean.Missing,
val flags: Optional = Optional.Missing(),
val buttons: Optional> = Optional.Missing()
) {
public companion object {
public fun from(entity: DiscordActivity): ActivityData = with(entity) {
ActivityData(
name,
type,
url,
createdAt,
timestamps,
applicationId,
details,
state,
emoji,
party,
assets,
secrets,
instance,
flags,
buttons
)
}
}
}