io.appwrite.models.Identity.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
/**
* Identity
*/
data class Identity(
/**
* Identity ID.
*/
@SerializedName("\$id")
val id: String,
/**
* Identity creation date in ISO 8601 format.
*/
@SerializedName("\$createdAt")
val createdAt: String,
/**
* Identity update date in ISO 8601 format.
*/
@SerializedName("\$updatedAt")
val updatedAt: String,
/**
* User ID.
*/
@SerializedName("userId")
val userId: String,
/**
* Identity Provider.
*/
@SerializedName("provider")
val provider: String,
/**
* ID of the User in the Identity Provider.
*/
@SerializedName("providerUid")
val providerUid: String,
/**
* Email of the User in the Identity Provider.
*/
@SerializedName("providerEmail")
val providerEmail: String,
/**
* Identity Provider Access Token.
*/
@SerializedName("providerAccessToken")
val providerAccessToken: String,
/**
* The date of when the access token expires in ISO 8601 format.
*/
@SerializedName("providerAccessTokenExpiry")
val providerAccessTokenExpiry: String,
/**
* Identity Provider Refresh Token.
*/
@SerializedName("providerRefreshToken")
val providerRefreshToken: String,
) {
fun toMap(): Map = mapOf(
"\$id" to id as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
"userId" to userId as Any,
"provider" to provider as Any,
"providerUid" to providerUid as Any,
"providerEmail" to providerEmail as Any,
"providerAccessToken" to providerAccessToken as Any,
"providerAccessTokenExpiry" to providerAccessTokenExpiry as Any,
"providerRefreshToken" to providerRefreshToken as Any,
)
companion object {
@Suppress("UNCHECKED_CAST")
fun from(
map: Map,
) = Identity(
id = map["\$id"] as String,
createdAt = map["\$createdAt"] as String,
updatedAt = map["\$updatedAt"] as String,
userId = map["userId"] as String,
provider = map["provider"] as String,
providerUid = map["providerUid"] as String,
providerEmail = map["providerEmail"] as String,
providerAccessToken = map["providerAccessToken"] as String,
providerAccessTokenExpiry = map["providerAccessTokenExpiry"] as String,
providerRefreshToken = map["providerRefreshToken"] as String,
)
}
}
© 2015 - 2024 Weber Informatics LLC | Privacy Policy