commonMain.org.jellyfin.sdk.model.api.PlaystateCommand.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jellyfin-model-jvm Show documentation
Show all versions of jellyfin-model-jvm Show documentation
Official Kotlin/Java SDK for Jellyfin. org.jellyfin.sdk:jellyfin-model-jvm
// !! WARNING
// !! DO NOT EDIT THIS FILE
//
// This file is generated by the openapi-generator module and is not meant for manual changes.
// Please read the README.md file in the openapi-generator module for additional information.
package org.jellyfin.sdk.model.api
import kotlin.String
import kotlin.requireNotNull
import kotlinx.serialization.SerialName
import kotlinx.serialization.Serializable
/**
* Enum PlaystateCommand.
*/
@Serializable
public enum class PlaystateCommand(
public val serialName: String,
) {
@SerialName("Stop")
STOP("Stop"),
@SerialName("Pause")
PAUSE("Pause"),
@SerialName("Unpause")
UNPAUSE("Unpause"),
@SerialName("NextTrack")
NEXT_TRACK("NextTrack"),
@SerialName("PreviousTrack")
PREVIOUS_TRACK("PreviousTrack"),
@SerialName("Seek")
SEEK("Seek"),
@SerialName("Rewind")
REWIND("Rewind"),
@SerialName("FastForward")
FAST_FORWARD("FastForward"),
@SerialName("PlayPause")
PLAY_PAUSE("PlayPause"),
;
/**
* Get the serial name of the enum member.
*/
override fun toString(): String = serialName
public companion object {
/**
* Find the enum member by the serial name or return null.
*/
public fun fromNameOrNull(serialName: String): PlaystateCommand? = when (serialName) {
"Stop" -> STOP
"Pause" -> PAUSE
"Unpause" -> UNPAUSE
"NextTrack" -> NEXT_TRACK
"PreviousTrack" -> PREVIOUS_TRACK
"Seek" -> SEEK
"Rewind" -> REWIND
"FastForward" -> FAST_FORWARD
"PlayPause" -> PLAY_PAUSE
else -> null
}
/**
* Find the enum member by the serial name or throw.
*/
public fun fromName(serialName: String): PlaystateCommand =
requireNotNull(fromNameOrNull(serialName)) { """Unknown value $serialName""" }
}
}