AO3Response

sealed class AO3Response<out T>

Represents a response from the service. An AO3Response can either be a Success or a Failure.

A Success response encapsulates the deserialised response obtained from a successful request in its Success.value.

A Failure response encapsulates the specific error thrown when the request fails for any reason in its Failure.error.

Inheritors

Types

Link copied to clipboard
data class Failure<T>(val error: AO3Error) : AO3Response<T>

Represents a scenario where AO3 returns a response that does not indicate success (i.e. not a 2XX response). The meaning of the error is context-specific; further type-checking should be done in order to discern its meaning.

Link copied to clipboard
data class Success<out T>(val value: T) : AO3Response<T>

Represents a success scenario. The expected result of the call is represented by value.