UpdateEvent

sealed class UpdateEvent : Event

Represents an update event within the ShieldCert SDK. This sealed class has specific update event types as subclasses.

internal fun updateEventHandlingExample() {
val updateEvent: UpdateEvent = UpdateEvent.Ok(listOf(/* ... Entry objects ... */))

when (updateEvent) {
UpdateEvent.Started -> println("Update process has started.")
UpdateEvent.Downloading -> println("Downloading certificate information...")
is UpdateEvent.Ok -> println("Update successful. Received ${updateEvent.data.size} entries.")
UpdateEvent.NetworkError -> println("A network error occurred during the update.")
is UpdateEvent.InvalidResponse -> println("Received an invalid response from the server: ${updateEvent.exception.message}")
}
}

Inheritors

Constructors

Link copied to clipboard
protected constructor()

Types

Link copied to clipboard
data object Downloading : UpdateEvent

Update in progress.

Link copied to clipboard
data class InvalidResponse(val exception: Exception) : UpdateEvent

The update request returned invalid responsea from the server.

Link copied to clipboard

There was an error in network communication with the server.

Link copied to clipboard
data class Ok(val data: List<Entry>) : UpdateEvent

Update succeeded. Everything is ok.

Link copied to clipboard
data object Started : UpdateEvent

Update started.