All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.cache.data.ActivityData.kt Maven / Gradle / Ivy

There is a newer version: 0.15.0
Show newest version
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
            )
        }
    }


}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy