io.appwrite.models.Document.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
/**
* Document
*/
data class Document(
/**
* Document ID.
*/
@SerializedName("\$id")
val id: String,
/**
* Collection ID.
*/
@SerializedName("\$collectionId")
val collectionId: String,
/**
* Database ID.
*/
@SerializedName("\$databaseId")
val databaseId: String,
/**
* Document creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,
/**
* Document update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,
/**
* Document permissions. [Learn more about permissions](/docs/permissions).
*/
@SerializedName("\$permissions")
val permissions: List,
/**
* Additional properties
*/
@SerializedName("data")
val data: T
) {
fun toMap(): Map = mapOf(
"\$id" to id as Any,
"\$collectionId" to collectionId as Any,
"\$databaseId" to databaseId as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"\$permissions" to permissions as Any,
"data" to data!!.jsonCast(to = Map::class.java)
)
companion object {
operator fun invoke(
id: String,
collectionId: String,
databaseId: String,
createdAt: String,
updatedAt: String,
permissions: List,
data: Map
) = Document
© 2015 - 2024 Weber Informatics LLC | Privacy Policy