Result

sealed class Result<out S, out F>

Generic response for api calls which wraps and encapsulates responses from Vehicle Integration Library. The Vehicle Integration Library should return an instance of this class every time when answer for requested operation could have 2 possible outcomes. The instance of Result.Success class will be returned in case when the requested operation is successfully finished and instance of Result.Failure will be returned in case when it is not possible to finished the operation successfully.

Inheritors

Types

Link copied to clipboard
data class Failure<out F>(val reason: F) : Result<Nothing, F>

Instance of this class will be returned when it is not possible to successfully finish the operation requested by the client.

Link copied to clipboard
data class Success<out S>(val value: S) : Result<S, Nothing>

Instance of this class will be returned when operation requested by the client is successfully finished.