Handle

sealed class Handle<out T : Model>(source)

Represents a reference to a resource in the API by URL.

Inheritors

Types

Link copied to clipboard
@Serializable(with = HandleSerializers.Named::class)
data class Named<out T : NamedModel> : Handle<T>

Represents a reference to another resource in the API by name and URL. This matches the "named resource" object pattern in the PokeAPI documentation. See: https://pokeapi.co/docs/v2#namedapiresource

Link copied to clipboard
@Serializable(with = HandleSerializers.Unnamed::class)
data class Unnamed<out T : Model> : Handle<T>

Represents a reference to another resource in the API by URL only. This matches the "resource" object pattern in the PokeAPI documentation. See: https://pokeapi.co/docs/v2#apiresource

Properties

Link copied to clipboard
val id: Int

The identifier for the resource.

Functions

Link copied to clipboard
suspend fun <T : Model> Handle<T>.get(): T