diff --git a/README.md b/README.md
index 859d5ca..2aa502b 100644
--- a/README.md
+++ b/README.md
@@ -2,12 +2,12 @@


-
+
[](https://travis-ci.com/appwrite/sdk-generator)
[](https://twitter.com/appwrite)
[](https://appwrite.io/discord)
-**This SDK is compatible with Appwrite server version 0.15.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
+**This SDK is compatible with Appwrite server version 1.0.0-RC1. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-android/releases).**
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 Android 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)
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
-implementation("io.appwrite:sdk-for-android:0.7.0")
+implementation("io.appwrite:sdk-for-android:0.8.0-SNAPSHOT")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
io.appwrite
sdk-for-android
- 0.7.0
+ 0.8.0-SNAPSHOT
```
diff --git a/docs/examples/java/databases/create-document.md b/docs/examples/java/databases/create-document.md
index 96aea79..7fc322b 100644
--- a/docs/examples/java/databases/create-document.md
+++ b/docs/examples/java/databases/create-document.md
@@ -16,9 +16,10 @@ public class MainActivity extends AppCompatActivity {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
- Databases databases = new Databases(client, "[DATABASE_ID]");
+ Databases databases = new Databases(client);
databases.createDocument(
+ "[DATABASE_ID]",
"[COLLECTION_ID]",
"[DOCUMENT_ID]",
mapOf( "a" to "b" ),
diff --git a/docs/examples/java/databases/delete-document.md b/docs/examples/java/databases/delete-document.md
index e749a0a..f42a09b 100644
--- a/docs/examples/java/databases/delete-document.md
+++ b/docs/examples/java/databases/delete-document.md
@@ -16,9 +16,10 @@ public class MainActivity extends AppCompatActivity {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
- Databases databases = new Databases(client, "[DATABASE_ID]");
+ Databases databases = new Databases(client);
databases.deleteDocument(
+ "[DATABASE_ID]",
"[COLLECTION_ID]",
"[DOCUMENT_ID]"
new Continuation() {
diff --git a/docs/examples/java/databases/get-document.md b/docs/examples/java/databases/get-document.md
index 2a7f227..f1a4d44 100644
--- a/docs/examples/java/databases/get-document.md
+++ b/docs/examples/java/databases/get-document.md
@@ -16,9 +16,10 @@ public class MainActivity extends AppCompatActivity {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
- Databases databases = new Databases(client, "[DATABASE_ID]");
+ Databases databases = new Databases(client);
databases.getDocument(
+ "[DATABASE_ID]",
"[COLLECTION_ID]",
"[DOCUMENT_ID]"
new Continuation() {
diff --git a/docs/examples/java/databases/list-documents.md b/docs/examples/java/databases/list-documents.md
index 5f49d26..93d7333 100644
--- a/docs/examples/java/databases/list-documents.md
+++ b/docs/examples/java/databases/list-documents.md
@@ -16,9 +16,10 @@ public class MainActivity extends AppCompatActivity {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
- Databases databases = new Databases(client, "[DATABASE_ID]");
+ Databases databases = new Databases(client);
databases.listDocuments(
+ "[DATABASE_ID]",
"[COLLECTION_ID]",
new Continuation() {
@NotNull
diff --git a/docs/examples/java/databases/update-document.md b/docs/examples/java/databases/update-document.md
index a9d361d..81e55d4 100644
--- a/docs/examples/java/databases/update-document.md
+++ b/docs/examples/java/databases/update-document.md
@@ -16,9 +16,10 @@ public class MainActivity extends AppCompatActivity {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2"); // Your project ID
- Databases databases = new Databases(client, "[DATABASE_ID]");
+ Databases databases = new Databases(client);
databases.updateDocument(
+ "[DATABASE_ID]",
"[COLLECTION_ID]",
"[DOCUMENT_ID]",
new Continuation() {
diff --git a/docs/examples/kotlin/account/create-phone-session.md b/docs/examples/kotlin/account/create-phone-session.md
index 899e3a3..2df83ad 100644
--- a/docs/examples/kotlin/account/create-phone-session.md
+++ b/docs/examples/kotlin/account/create-phone-session.md
@@ -19,7 +19,7 @@ class MainActivity : AppCompatActivity() {
GlobalScope.launch {
val response = account.createPhoneSession(
userId = "[USER_ID]",
- number = ""
+ phone = ""
)
val json = response.body?.string()
}
diff --git a/docs/examples/kotlin/account/update-phone.md b/docs/examples/kotlin/account/update-phone.md
index b200b5b..8ffef51 100644
--- a/docs/examples/kotlin/account/update-phone.md
+++ b/docs/examples/kotlin/account/update-phone.md
@@ -18,7 +18,7 @@ class MainActivity : AppCompatActivity() {
GlobalScope.launch {
val response = account.updatePhone(
- number = "",
+ phone = "",
password = "password"
)
val json = response.body?.string()
diff --git a/docs/examples/kotlin/databases/create-document.md b/docs/examples/kotlin/databases/create-document.md
index 37e20de..8a755a2 100644
--- a/docs/examples/kotlin/databases/create-document.md
+++ b/docs/examples/kotlin/databases/create-document.md
@@ -14,10 +14,11 @@ class MainActivity : AppCompatActivity() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
- val databases = Databases(client, "[DATABASE_ID]")
+ val databases = Databases(client)
GlobalScope.launch {
val response = databases.createDocument(
+ databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
data = mapOf( "a" to "b" ),
diff --git a/docs/examples/kotlin/databases/delete-document.md b/docs/examples/kotlin/databases/delete-document.md
index aa5e3ef..f56293b 100644
--- a/docs/examples/kotlin/databases/delete-document.md
+++ b/docs/examples/kotlin/databases/delete-document.md
@@ -14,10 +14,11 @@ class MainActivity : AppCompatActivity() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
- val databases = Databases(client, "[DATABASE_ID]")
+ val databases = Databases(client)
GlobalScope.launch {
val response = databases.deleteDocument(
+ databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]"
)
diff --git a/docs/examples/kotlin/databases/get-document.md b/docs/examples/kotlin/databases/get-document.md
index 9acc860..1f5bf29 100644
--- a/docs/examples/kotlin/databases/get-document.md
+++ b/docs/examples/kotlin/databases/get-document.md
@@ -14,10 +14,11 @@ class MainActivity : AppCompatActivity() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
- val databases = Databases(client, "[DATABASE_ID]")
+ val databases = Databases(client)
GlobalScope.launch {
val response = databases.getDocument(
+ databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]"
)
diff --git a/docs/examples/kotlin/databases/list-documents.md b/docs/examples/kotlin/databases/list-documents.md
index 48295f4..5277b46 100644
--- a/docs/examples/kotlin/databases/list-documents.md
+++ b/docs/examples/kotlin/databases/list-documents.md
@@ -14,10 +14,11 @@ class MainActivity : AppCompatActivity() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
- val databases = Databases(client, "[DATABASE_ID]")
+ val databases = Databases(client)
GlobalScope.launch {
val response = databases.listDocuments(
+ databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
)
val json = response.body?.string()
diff --git a/docs/examples/kotlin/databases/update-document.md b/docs/examples/kotlin/databases/update-document.md
index 6e73fa1..7807f52 100644
--- a/docs/examples/kotlin/databases/update-document.md
+++ b/docs/examples/kotlin/databases/update-document.md
@@ -14,10 +14,11 @@ class MainActivity : AppCompatActivity() {
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
- val databases = Databases(client, "[DATABASE_ID]")
+ val databases = Databases(client)
GlobalScope.launch {
val response = databases.updateDocument(
+ databaseId = "[DATABASE_ID]",
collectionId = "[COLLECTION_ID]",
documentId = "[DOCUMENT_ID]",
)
diff --git a/library/src/main/java/io/appwrite/Client.kt b/library/src/main/java/io/appwrite/Client.kt
index be46747..761fbaa 100644
--- a/library/src/main/java/io/appwrite/Client.kt
+++ b/library/src/main/java/io/appwrite/Client.kt
@@ -85,8 +85,11 @@ class Client @JvmOverloads constructor(
"content-type" to "application/json",
"origin" to "appwrite-android://${context.packageName}",
"user-agent" to "${context.packageName}/${appVersion}, ${System.getProperty("http.agent")}",
- "x-sdk-version" to "appwrite:android:${BuildConfig.SDK_VERSION}",
- "x-appwrite-response-format" to "0.15.0"
+ "x-sdk-name" to "Android",
+ "x-sdk-platform" to "client",
+ "x-sdk-language" to "android",
+ "x-sdk-version" to "0.8.0-SNAPSHOT",
+ "x-appwrite-response-format" to "1.0.0-RC1"
)
config = mutableMapOf()
diff --git a/library/src/main/java/io/appwrite/models/Account.kt b/library/src/main/java/io/appwrite/models/Account.kt
index 754c94a..1450b82 100644
--- a/library/src/main/java/io/appwrite/models/Account.kt
+++ b/library/src/main/java/io/appwrite/models/Account.kt
@@ -14,18 +14,18 @@ data class Account(
val id: String,
/**
- * User creation date in Unix timestamp.
+ * User creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
- val createdAt: Long,
+ val createdAt: String,
/**
- * User update date in Unix timestamp.
+ * User update date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
- val updatedAt: Long,
+ val updatedAt: String,
/**
* User name.
@@ -35,7 +35,7 @@ data class Account(
val name: String,
/**
- * User registration date in Datetime.
+ * User registration date in ISO 8601 format.
*
*/
@SerializedName("registration")
@@ -49,7 +49,7 @@ data class Account(
val status: Boolean,
/**
- * Datetime of the most recent password update
+ * Password update time in ISO 8601 format.
*
*/
@SerializedName("passwordUpdate")
@@ -94,8 +94,8 @@ data class Account(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Account(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
name = map["name"] as String,
registration = map["registration"] as String,
status = map["status"] as Boolean,
diff --git a/library/src/main/java/io/appwrite/models/Document.kt b/library/src/main/java/io/appwrite/models/Document.kt
index b8f0a82..d527f7c 100644
--- a/library/src/main/java/io/appwrite/models/Document.kt
+++ b/library/src/main/java/io/appwrite/models/Document.kt
@@ -21,28 +21,14 @@ data class Document(
val collection: String,
/**
- * Document creation date in Unix timestamp.
- *
- */
- @SerializedName("\$createdAt")
- val createdAt: Long,
-
- /**
- * Document update date in Unix timestamp.
- *
- */
- @SerializedName("\$updatedAt")
- val updatedAt: Long,
-
- /**
- * Document read permissions.
+ * Document creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
val createdAt: String,
/**
- * Document update date in Datetime
+ * Document update date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
@@ -62,10 +48,9 @@ data class Document(
fun from(map: Map) = Document(
id = map["\$id"] as String,
collection = map["\$collection"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
- read = map["\$read"] as List,
- write = map["\$write"] as List,
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
+ permissions = map["\$permissions"] as List,
data = map
)
}
@@ -75,8 +60,7 @@ data class Document(
"\$collection" to collection as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
- "\$read" to read as Any,
- "\$write" to write as Any,
+ "\$permissions" to permissions as Any,
"data" to data
)
diff --git a/library/src/main/java/io/appwrite/models/Execution.kt b/library/src/main/java/io/appwrite/models/Execution.kt
index 7fb8467..46495bf 100644
--- a/library/src/main/java/io/appwrite/models/Execution.kt
+++ b/library/src/main/java/io/appwrite/models/Execution.kt
@@ -14,28 +14,14 @@ data class Execution(
val id: String,
/**
- * Execution creation date in Unix timestamp.
- *
- */
- @SerializedName("\$createdAt")
- val createdAt: Long,
-
- /**
- * Execution update date in Unix timestamp.
- *
- */
- @SerializedName("\$updatedAt")
- val updatedAt: Long,
-
- /**
- * Execution read permissions.
+ * Execution creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
val createdAt: String,
/**
- * Execution upate date in Datetime
+ * Execution upate date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
@@ -48,6 +34,13 @@ data class Execution(
@SerializedName("\$permissions")
val permissions: List,
+ /**
+ * Function ID.
+ *
+ */
+ @SerializedName("functionId")
+ val functionId: String,
+
/**
* The trigger that caused the function to execute. Possible values can be: `http`, `schedule`, or `event`.
*
@@ -101,9 +94,9 @@ data class Execution(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Execution(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
- read = map["\$read"] as List,
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
+ permissions = map["\$permissions"] as List,
functionId = map["functionId"] as String,
trigger = map["trigger"] as String,
status = map["status"] as String,
@@ -119,7 +112,7 @@ data class Execution(
"\$id" to id as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
- "\$read" to read as Any,
+ "\$permissions" to permissions as Any,
"functionId" to functionId as Any,
"trigger" to trigger as Any,
"status" to status as Any,
diff --git a/library/src/main/java/io/appwrite/models/File.kt b/library/src/main/java/io/appwrite/models/File.kt
index f726121..3f1a296 100644
--- a/library/src/main/java/io/appwrite/models/File.kt
+++ b/library/src/main/java/io/appwrite/models/File.kt
@@ -21,28 +21,14 @@ data class File(
val bucketId: String,
/**
- * File creation date in Unix timestamp.
- *
- */
- @SerializedName("\$createdAt")
- val createdAt: Long,
-
- /**
- * File update date in Unix timestamp.
- *
- */
- @SerializedName("\$updatedAt")
- val updatedAt: Long,
-
- /**
- * File read permissions.
+ * File creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
val createdAt: String,
/**
- * File update date in Datetime
+ * File update date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
@@ -55,6 +41,13 @@ data class File(
@SerializedName("\$permissions")
val permissions: List,
+ /**
+ * File name.
+ *
+ */
+ @SerializedName("name")
+ val name: String,
+
/**
* File MD5 signature.
*
@@ -95,10 +88,9 @@ data class File(
fun from(map: Map) = File(
id = map["\$id"] as String,
bucketId = map["bucketId"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
- read = map["\$read"] as List,
- write = map["\$write"] as List,
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
+ permissions = map["\$permissions"] as List,
name = map["name"] as String,
signature = map["signature"] as String,
mimeType = map["mimeType"] as String,
@@ -113,8 +105,7 @@ data class File(
"bucketId" to bucketId as Any,
"\$createdAt" to createdAt as Any,
"\$updatedAt" to updatedAt as Any,
- "\$read" to read as Any,
- "\$write" to write as Any,
+ "\$permissions" to permissions as Any,
"name" to name as Any,
"signature" to signature as Any,
"mimeType" to mimeType as Any,
diff --git a/library/src/main/java/io/appwrite/models/Log.kt b/library/src/main/java/io/appwrite/models/Log.kt
index 7d7dcdf..2343352 100644
--- a/library/src/main/java/io/appwrite/models/Log.kt
+++ b/library/src/main/java/io/appwrite/models/Log.kt
@@ -49,7 +49,7 @@ data class Log(
val ip: String,
/**
- * Log creation date in Datetime.
+ * Log creation date in ISO 8601 format.
*
*/
@SerializedName("time")
diff --git a/library/src/main/java/io/appwrite/models/Membership.kt b/library/src/main/java/io/appwrite/models/Membership.kt
index b9e3a60..a923fea 100644
--- a/library/src/main/java/io/appwrite/models/Membership.kt
+++ b/library/src/main/java/io/appwrite/models/Membership.kt
@@ -14,18 +14,18 @@ data class Membership(
val id: String,
/**
- * Membership creation date in Unix timestamp.
+ * Membership creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
- val createdAt: Long,
+ val createdAt: String,
/**
- * Membership update date in Unix timestamp.
+ * Membership update date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
- val updatedAt: Long,
+ val updatedAt: String,
/**
* User ID.
@@ -63,14 +63,14 @@ data class Membership(
val teamName: String,
/**
- * Date, the user has been invited to join the team in Datetime
+ * Date, the user has been invited to join the team in ISO 8601 format.
*
*/
@SerializedName("invited")
val invited: String,
/**
- * Date, the user has accepted the invitation to join the team in Datetime
+ * Date, the user has accepted the invitation to join the team in ISO 8601 format.
*
*/
@SerializedName("joined")
@@ -94,8 +94,8 @@ data class Membership(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Membership(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
userId = map["userId"] as String,
userName = map["userName"] as String,
userEmail = map["userEmail"] as String,
diff --git a/library/src/main/java/io/appwrite/models/Session.kt b/library/src/main/java/io/appwrite/models/Session.kt
index 54ca106..3510640 100644
--- a/library/src/main/java/io/appwrite/models/Session.kt
+++ b/library/src/main/java/io/appwrite/models/Session.kt
@@ -14,11 +14,11 @@ data class Session(
val id: String,
/**
- * Session creation date in Unix timestamp.
+ * Session creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
- val createdAt: Long,
+ val createdAt: String,
/**
* User ID.
@@ -28,7 +28,7 @@ data class Session(
val userId: String,
/**
- * Session expiration date in Datetime
+ * Session expiration date in ISO 8601 format.
*
*/
@SerializedName("expire")
@@ -56,7 +56,7 @@ data class Session(
val providerAccessToken: String,
/**
- * The date of when the access token expires in Datetime format.
+ * The date of when the access token expires in ISO 8601 format.
*
*/
@SerializedName("providerAccessTokenExpiry")
@@ -185,7 +185,7 @@ data class Session(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Session(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
+ createdAt = map["\$createdAt"] as String,
userId = map["userId"] as String,
expire = map["expire"] as String,
provider = map["provider"] as String,
diff --git a/library/src/main/java/io/appwrite/models/Team.kt b/library/src/main/java/io/appwrite/models/Team.kt
index 4a5dbcd..c3b038f 100644
--- a/library/src/main/java/io/appwrite/models/Team.kt
+++ b/library/src/main/java/io/appwrite/models/Team.kt
@@ -14,18 +14,18 @@ data class Team(
val id: String,
/**
- * Team creation date in Unix timestamp.
+ * Team creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
- val createdAt: Long,
+ val createdAt: String,
/**
- * Team update date in Unix timestamp.
+ * Team update date in ISO 8601 format.
*
*/
@SerializedName("\$updatedAt")
- val updatedAt: Long,
+ val updatedAt: String,
/**
* Team name.
@@ -45,8 +45,8 @@ data class Team(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Team(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
- updatedAt = (map["\$updatedAt"] as Number).toLong(),
+ createdAt = map["\$createdAt"] as String,
+ updatedAt = map["\$updatedAt"] as String,
name = map["name"] as String,
total = (map["total"] as Number).toLong()
)
diff --git a/library/src/main/java/io/appwrite/models/Token.kt b/library/src/main/java/io/appwrite/models/Token.kt
index 485cdeb..2587776 100644
--- a/library/src/main/java/io/appwrite/models/Token.kt
+++ b/library/src/main/java/io/appwrite/models/Token.kt
@@ -14,11 +14,11 @@ data class Token(
val id: String,
/**
- * Token creation date in Unix timestamp.
+ * Token creation date in ISO 8601 format.
*
*/
@SerializedName("\$createdAt")
- val createdAt: Long,
+ val createdAt: String,
/**
* User ID.
@@ -35,7 +35,7 @@ data class Token(
val secret: String,
/**
- * Token expiration date in Datetime.
+ * Token expiration date in ISO 8601 format.
*
*/
@SerializedName("expire")
@@ -45,7 +45,7 @@ data class Token(
@Suppress("UNCHECKED_CAST")
fun from(map: Map) = Token(
id = map["\$id"] as String,
- createdAt = (map["\$createdAt"] as Number).toLong(),
+ createdAt = map["\$createdAt"] as String,
userId = map["userId"] as String,
secret = map["secret"] as String,
expire = map["expire"] as String
diff --git a/library/src/main/java/io/appwrite/services/Account.kt b/library/src/main/java/io/appwrite/services/Account.kt
index 0156896..02fd660 100644
--- a/library/src/main/java/io/appwrite/services/Account.kt
+++ b/library/src/main/java/io/appwrite/services/Account.kt
@@ -313,45 +313,6 @@ class Account : Service {
)
}
- /**
- * Update Account Phone
- *
- * Update currently logged in user account phone number. After changing phone
- * number, the user confirmation status will get reset. A new confirmation SMS
- * is not sent automatically however you can use the phone confirmation
- * endpoint again to send the confirmation SMS.
- *
- * @param number Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
- * @param password User password. Must be at least 8 chars.
- * @return [io.appwrite.models.User]
- */
- @JvmOverloads
- @Throws(AppwriteException::class)
- suspend fun updatePhone(
- number: String,
- password: String
- ): io.appwrite.models.User {
- val path = "/account/phone"
- val params = mutableMapOf(
- "number" to number,
- "password" to password
- )
- val headers = mutableMapOf(
- "content-type" to "application/json"
- )
- val converter: (Map) -> io.appwrite.models.User = {
- io.appwrite.models.User.from(map = it)
- }
- return client.call(
- "PATCH",
- path,
- headers,
- params,
- responseType = io.appwrite.models.User::class.java,
- converter,
- )
- }
-
/**
* Get Account Preferences
*
@@ -747,7 +708,7 @@ class Account : Service {
* user..
*
*
- * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, bitbucket, bitly, box, dailymotion, discord, dropbox, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.
+ * @param provider OAuth2 Provider. Currently, supported providers are: amazon, apple, auth0, authentik, autodesk, bitbucket, bitly, box, dailymotion, discord, disqus, dropbox, etsy, facebook, github, gitlab, google, linkedin, microsoft, notion, okta, paypal, paypalSandbox, podio, salesforce, slack, spotify, stripe, tradeshift, tradeshiftBox, twitch, wordpress, yahoo, yammer, yandex, zoom.
* @param success URL to redirect back to your app after a successful login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param failure URL to redirect back to your app after a failed login attempt. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @param scopes A list of custom OAuth2 scopes. Check each provider internal docs for a list of supported scopes. Maximum of 100 scopes are allowed, each 4096 characters long.
@@ -816,26 +777,27 @@ class Account : Service {
/**
* Create Phone session
*
- * Sends the user a SMS with a secret key for creating a session. Use the
- * returned user ID and the secret to submit a request to the [PUT
+ * Sends the user an SMS with a secret key for creating a session. If the
+ * provided user ID has not be registered, a new user will be created. Use the
+ * returned user ID and secret and submit a request to the [PUT
* /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession)
* endpoint to complete the login process. The secret sent to the user's phone
* is valid for 15 minutes.
*
* @param userId Unique Id. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
- * @param number Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
+ * @param phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
* @return [io.appwrite.models.Token]
*/
@JvmOverloads
@Throws(AppwriteException::class)
suspend fun createPhoneSession(
userId: String,
- number: String
+ phone: String
): io.appwrite.models.Token {
val path = "/account/sessions/phone"
val params = mutableMapOf(
"userId" to userId,
- "number" to number
+ "phone" to phone
)
val headers = mutableMapOf(
"content-type" to "application/json"
@@ -854,19 +816,13 @@ class Account : Service {
}
/**
- * Create Phone session (confirmation)
+ * Create Phone Session (confirmation)
*
- * Use this endpoint to complete creating the session with the Magic URL. Both
- * the **userId** and **secret** arguments will be passed as query parameters
- * to the redirect URL you have provided when sending your request to the
- * [POST
- * /account/sessions/magic-url](/docs/client/account#accountCreateMagicURLSession)
- * endpoint.
- *
- * Please note that in order to avoid a [Redirect
- * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
- * the only valid redirect URLs are the ones from domains you have set when
- * adding your platforms in the console interface.
+ * Use this endpoint to complete creating a session with SMS. Use the
+ * **userId** from the
+ * [createPhoneSession](/docs/client/account#accountCreatePhoneSession)
+ * endpoint and the **secret** received via SMS to successfully update and
+ * confirm the phone session.
*
* @param userId User ID.
* @param secret Valid verification token.
@@ -1117,13 +1073,12 @@ class Account : Service {
/**
* Create Phone Verification
*
- * Use this endpoint to send a verification message to your user's phone
- * number to confirm they are the valid owners of that address. The provided
- * secret should allow you to complete the verification process by verifying
- * both the **userId** and **secret** parameters. Learn more about how to
- * [complete the verification
+ * Use this endpoint to send a verification SMS to the currently logged in
+ * user. This endpoint is meant for use after updating a user's phone number
+ * using the [accountUpdatePhone](/docs/client/account#accountUpdatePhone)
+ * endpoint. Learn more about how to [complete the verification
* process](/docs/client/account#accountUpdatePhoneVerification). The
- * verification link sent to the user's phone number is valid for 15 minutes.
+ * verification code sent to the user's phone number is valid for 15 minutes.
*
* @return [io.appwrite.models.Token]
*/
diff --git a/library/src/main/java/io/appwrite/services/Databases.kt b/library/src/main/java/io/appwrite/services/Databases.kt
index 2a63485..65f1ead 100644
--- a/library/src/main/java/io/appwrite/services/Databases.kt
+++ b/library/src/main/java/io/appwrite/services/Databases.kt
@@ -10,23 +10,19 @@ import java.io.File
class Databases : Service {
- val databaseId: String
-
- public constructor(client: Client, databaseId: String) : super(client) {
- this.databaseId = databaseId
- }
+ public constructor (client: Client) : super(client) { }
/**
* List Documents
*
- * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
- * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/database#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.
- * @param limit Maximum number of documents to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
- * @param offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursor ID of the document used as the starting point for the query, excluding the document itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursorDirection Direction of the cursor, can be either 'before' or 'after'.
- * @param orderAttributes Array of attributes used to sort results. Maximum of 100 order attributes are allowed, each 4096 characters long.
- * @param orderTypes Array of order directions for sorting attribtues. Possible values are DESC for descending order, or ASC for ascending order. Maximum of 100 order types are allowed.
+ * Get a list of all the user's documents in a given collection. You can use
+ * the query params to filter your results. On admin mode, this endpoint will
+ * return a list of all of documents belonging to the provided collectionId.
+ * [Learn more about different API modes](/docs/admin).
+ *
+ * @param databaseId Database ID.
+ * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
+ * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long.
* @return [io.appwrite.models.DocumentList]
*/
@JvmOverloads
@@ -59,7 +55,13 @@ class Databases : Service {
/**
* Create Document
*
- * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection). Make sure to define attributes before creating documents.
+ * Create a new Document. Before using this route, you should create a new
+ * collection resource using either a [server
+ * integration](/docs/server/databases#databasesCreateCollection) API or
+ * directly from your database console.
+ *
+ * @param databaseId Database ID.
+ * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
* @param documentId Document ID. Choose your own unique ID or pass the string "unique()" to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param data Document data as JSON object.
* @param permissions An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).
@@ -99,7 +101,11 @@ class Databases : Service {
/**
* Get Document
*
- * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
+ * Get a document by its unique ID. This endpoint response returns a JSON
+ * object with the document data.
+ *
+ * @param databaseId Database ID.
+ * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @param documentId Document ID.
* @return [io.appwrite.models.Document]
*/
@@ -132,6 +138,10 @@ class Databases : Service {
/**
* Update Document
*
+ * Update a document by its unique ID. Using the patch method you can pass
+ * only specific fields that will get updated.
+ *
+ * @param databaseId Database ID.
* @param collectionId Collection ID.
* @param documentId Document ID.
* @param data Document data as JSON object. Include only attribute and value pairs to be updated.
@@ -145,8 +155,7 @@ class Databases : Service {
collectionId: String,
documentId: String,
data: Any? = null,
- read: List? = null,
- write: List? = null
+ permissions: List? = null
): io.appwrite.models.Document {
val path = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId)
val params = mutableMapOf(
@@ -172,7 +181,10 @@ class Databases : Service {
/**
* Delete Document
*
- * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/database#createCollection).
+ * Delete a document by its unique ID.
+ *
+ * @param databaseId Database ID.
+ * @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
* @param documentId Document ID.
* @return [Any]
*/
diff --git a/library/src/main/java/io/appwrite/services/Functions.kt b/library/src/main/java/io/appwrite/services/Functions.kt
index f49f7bd..1c50538 100644
--- a/library/src/main/java/io/appwrite/services/Functions.kt
+++ b/library/src/main/java/io/appwrite/services/Functions.kt
@@ -53,8 +53,6 @@ class Functions : Service {
* @param functionId Function ID.
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, statusCode, time
* @param search Search term to filter your list results. Max length: 256 chars.
- * @param cursor ID of the execution used as the starting point for the query, excluding the execution itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursorDirection Direction of the cursor, can be either 'before' or 'after'.
* @return [io.appwrite.models.ExecutionList]
*/
@JvmOverloads
diff --git a/library/src/main/java/io/appwrite/services/Storage.kt b/library/src/main/java/io/appwrite/services/Storage.kt
index 6c6e02b..053e0e6 100644
--- a/library/src/main/java/io/appwrite/services/Storage.kt
+++ b/library/src/main/java/io/appwrite/services/Storage.kt
@@ -24,11 +24,6 @@ class Storage : Service {
* @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, signature, mimeType, sizeOriginal, chunksTotal, chunksUploaded
* @param search Search term to filter your list results. Max length: 256 chars.
- * @param limit Maximum number of files to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
- * @param offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursor ID of the file used as the starting point for the query, excluding the file itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursorDirection Direction of the cursor, can be either 'before' or 'after'.
- * @param orderType Order result by ASC or DESC order.
* @return [io.appwrite.models.FileList]
*/
@JvmOverloads
@@ -93,8 +88,7 @@ class Storage : Service {
bucketId: String,
fileId: String,
file: InputFile,
- read: List? = null,
- write: List? = null, onProgress: ((UploadProgress) -> Unit)? = null
+ permissions: List? = null, onProgress: ((UploadProgress) -> Unit)? = null
): io.appwrite.models.File {
val path = "/storage/buckets/{bucketId}/files".replace("{bucketId}", bucketId)
val params = mutableMapOf(
diff --git a/library/src/main/java/io/appwrite/services/Teams.kt b/library/src/main/java/io/appwrite/services/Teams.kt
index 4092e96..46fe9d0 100644
--- a/library/src/main/java/io/appwrite/services/Teams.kt
+++ b/library/src/main/java/io/appwrite/services/Teams.kt
@@ -16,18 +16,13 @@ class Teams : Service {
* List Teams
*
* Get a list of all the teams in which the current user is a member. You can
- * use the parameters to filter your results.
- *
+ * use the parameters to filter your results.
+ *
* In admin mode, this endpoint returns a list of all the teams in the current
* project. [Learn more about different API modes](/docs/admin).
*
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total
* @param search Search term to filter your list results. Max length: 256 chars.
- * @param limit Maximum number of teams to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
- * @param offset Offset value. The default value is 0. Use this param to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursor ID of the team used as the starting point for the query, excluding the team itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursorDirection Direction of the cursor, can be either 'before' or 'after'.
- * @param orderType Order result by ASC or DESC order.
* @return [io.appwrite.models.TeamList]
*/
@JvmOverloads
@@ -204,11 +199,6 @@ class Teams : Service {
* @param teamId Team ID.
* @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/databases#querying-documents). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm
* @param search Search term to filter your list results. Max length: 256 chars.
- * @param limit Maximum number of memberships to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.
- * @param offset Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursor ID of the membership used as the starting point for the query, excluding the membership itself. Should be used for efficient pagination when working with large sets of data. [learn more about pagination](https://appwrite.io/docs/pagination)
- * @param cursorDirection Direction of the cursor, can be either 'before' or 'after'.
- * @param orderType Order result by ASC or DESC order.
* @return [io.appwrite.models.MembershipList]
*/
@JvmOverloads