All Downloads are FREE. Search and download functionalities are using the official Maven repository.

io.appwrite.models.Runtime.kt Maven / Gradle / Ivy

Go to download

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)

There is a newer version: 6.1.0
Show newest version
package io.appwrite.models

import com.google.gson.annotations.SerializedName
import io.appwrite.extensions.jsonCast

/**
 * Runtime
 */
data class Runtime(
    /**
     * Runtime ID.
     */
    @SerializedName("\$id")
    val id: String,

    /**
     * Runtime Name.
     */
    @SerializedName("name")
    val name: String,

    /**
     * Runtime version.
     */
    @SerializedName("version")
    val version: String,

    /**
     * Base Docker image used to build the runtime.
     */
    @SerializedName("base")
    val base: String,

    /**
     * Image name of Docker Hub.
     */
    @SerializedName("image")
    val image: String,

    /**
     * Name of the logo image.
     */
    @SerializedName("logo")
    val logo: String,

    /**
     * List of supported architectures.
     */
    @SerializedName("supports")
    val supports: List,

) {
    fun toMap(): Map = mapOf(
        "\$id" to id as Any,
        "name" to name as Any,
        "version" to version as Any,
        "base" to base as Any,
        "image" to image as Any,
        "logo" to logo as Any,
        "supports" to supports as Any,
    )

    companion object {

        @Suppress("UNCHECKED_CAST")
        fun from(
            map: Map,
        ) = Runtime(
            id = map["\$id"] as String,
            name = map["name"] as String,
            version = map["version"] as String,
            base = map["base"] as String,
            image = map["image"] as String,
            logo = map["logo"] as String,
            supports = map["supports"] as List,
        )
    }
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy