Device

@Serializable
data class Device(val id: String? = null, val isActive: Boolean, val isPrivateSession: Boolean, val isRestricted: Boolean, val name: String, val typeString: String, val volumePercent: Int) : IdentifiableNullable(source)

A device which is connected to the Spotify user

Parameters

id

The device ID. This may be null.

isActive

If this device is the currently active device.

isPrivateSession

If this device is currently in a private session.

isRestricted

Whether controlling this device is restricted. At present if this is “true” then no Web API commands will be accepted by this device.

name

The name of the device.

Constructors

Link copied to clipboard
constructor(id: String? = null, isActive: Boolean, isPrivateSession: Boolean, isRestricted: Boolean, name: String, typeString: String, volumePercent: Int)

Properties

Link copied to clipboard
@Transient
lateinit var api: GenericSpotifyApi

The API client associated with the request

Link copied to clipboard
open override val href: String? = null

A link to the Spotify web api endpoint associated with this request

Link copied to clipboard
open override val id: String? = null
Link copied to clipboard
@SerialName(value = "is_active")
val isActive: Boolean
Link copied to clipboard
@SerialName(value = "is_private_session")
val isPrivateSession: Boolean
Link copied to clipboard
@SerialName(value = "is_restricted")
val isRestricted: Boolean
Link copied to clipboard
Link copied to clipboard

Device type, such as “Computer”, “Smartphone” or “Speaker”.

Link copied to clipboard
@SerialName(value = "type")
val typeString: String
Link copied to clipboard
@SerialName(value = "volume_percent")
val volumePercent: Int