io.appwrite.models.HealthStatus.kt Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of sdk-for-kotlin Show documentation
Show all versions of sdk-for-kotlin Show documentation
Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Kotlin SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)
package io.appwrite.models
import com.google.gson.annotations.SerializedName
import io.appwrite.extensions.jsonCast
/**
* Health Status
*/
data class HealthStatus(
/**
* Name of the service.
*/
@SerializedName("name")
val name: String,
/**
* Duration in milliseconds how long the health check took.
*/
@SerializedName("ping")
val ping: Long,
/**
* Service status. Possible values can are: `pass`, `fail`
*/
@SerializedName("status")
val status: String,
) {
fun toMap(): Map = mapOf(
"name" to name as Any,
"ping" to ping as Any,
"status" to status as Any,
)
companion object {
@Suppress("UNCHECKED_CAST")
fun from(
map: Map,
) = HealthStatus(
name = map["name"] as String,
ping = (map["ping"] as Number).toLong(),
status = map["status"] as String,
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy