From 837693561a2c4acbaad2e511587f8603ec80670a Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 3 Nov 2025 16:31:49 +1300 Subject: [PATCH 1/2] Add operators --- CHANGELOG.md | 5 + README.md | 4 +- docs/examples/java/account/list-identities.md | 1 + docs/examples/java/account/list-logs.md | 1 + .../java/databases/create-collection.md | 4 +- .../java/databases/create-document.md | 4 +- .../java/databases/list-attributes.md | 1 + .../java/databases/list-collections.md | 1 + .../examples/java/databases/list-documents.md | 1 + docs/examples/java/databases/list-indexes.md | 1 + docs/examples/java/databases/list.md | 1 + .../java/databases/update-collection.md | 4 +- .../java/databases/update-document.md | 4 +- .../java/databases/upsert-document.md | 4 +- .../java/functions/list-deployments.md | 1 + .../java/functions/list-executions.md | 1 + docs/examples/java/functions/list.md | 1 + .../java/messaging/create-resend-provider.md | 30 ++++ .../java/messaging/list-message-logs.md | 1 + docs/examples/java/messaging/list-messages.md | 1 + .../java/messaging/list-provider-logs.md | 1 + .../examples/java/messaging/list-providers.md | 1 + .../java/messaging/list-subscriber-logs.md | 1 + .../java/messaging/list-subscribers.md | 1 + docs/examples/java/messaging/list-targets.md | 1 + .../java/messaging/list-topic-logs.md | 1 + docs/examples/java/messaging/list-topics.md | 1 + .../java/messaging/update-resend-provider.md | 30 ++++ docs/examples/java/sites/list-deployments.md | 1 + docs/examples/java/sites/list-logs.md | 1 + docs/examples/java/sites/list.md | 1 + docs/examples/java/storage/create-bucket.md | 4 +- docs/examples/java/storage/create-file.md | 4 +- docs/examples/java/storage/list-buckets.md | 1 + docs/examples/java/storage/list-files.md | 1 + docs/examples/java/storage/update-bucket.md | 4 +- docs/examples/java/storage/update-file.md | 4 +- docs/examples/java/tablesdb/create-row.md | 4 +- docs/examples/java/tablesdb/create-table.md | 4 +- docs/examples/java/tablesdb/list-columns.md | 1 + docs/examples/java/tablesdb/list-indexes.md | 1 + docs/examples/java/tablesdb/list-rows.md | 1 + docs/examples/java/tablesdb/list-tables.md | 1 + docs/examples/java/tablesdb/list.md | 1 + docs/examples/java/tablesdb/update-row.md | 4 +- docs/examples/java/tablesdb/update-table.md | 4 +- docs/examples/java/tablesdb/upsert-row.md | 4 +- docs/examples/java/teams/list-memberships.md | 1 + docs/examples/java/teams/list.md | 1 + docs/examples/java/tokens/list.md | 1 + docs/examples/java/users/list-identities.md | 1 + docs/examples/java/users/list-logs.md | 1 + docs/examples/java/users/list-memberships.md | 1 + docs/examples/java/users/list-sessions.md | 1 + docs/examples/java/users/list-targets.md | 1 + docs/examples/java/users/list.md | 1 + .../kotlin/account/list-identities.md | 3 +- docs/examples/kotlin/account/list-logs.md | 3 +- .../kotlin/databases/create-collection.md | 4 +- .../kotlin/databases/create-document.md | 4 +- .../kotlin/databases/list-attributes.md | 3 +- .../kotlin/databases/list-collections.md | 3 +- .../kotlin/databases/list-documents.md | 3 +- .../examples/kotlin/databases/list-indexes.md | 3 +- docs/examples/kotlin/databases/list.md | 3 +- .../kotlin/databases/update-collection.md | 4 +- .../kotlin/databases/update-document.md | 4 +- .../kotlin/databases/upsert-document.md | 4 +- .../kotlin/functions/list-deployments.md | 3 +- .../kotlin/functions/list-executions.md | 3 +- docs/examples/kotlin/functions/list.md | 3 +- .../messaging/create-resend-provider.md | 21 +++ .../kotlin/messaging/list-message-logs.md | 3 +- .../kotlin/messaging/list-messages.md | 3 +- .../kotlin/messaging/list-provider-logs.md | 3 +- .../kotlin/messaging/list-providers.md | 3 +- .../kotlin/messaging/list-subscriber-logs.md | 3 +- .../kotlin/messaging/list-subscribers.md | 3 +- .../examples/kotlin/messaging/list-targets.md | 3 +- .../kotlin/messaging/list-topic-logs.md | 3 +- docs/examples/kotlin/messaging/list-topics.md | 3 +- .../messaging/update-resend-provider.md | 21 +++ .../examples/kotlin/sites/list-deployments.md | 3 +- docs/examples/kotlin/sites/list-logs.md | 3 +- docs/examples/kotlin/sites/list.md | 3 +- docs/examples/kotlin/storage/create-bucket.md | 4 +- docs/examples/kotlin/storage/create-file.md | 4 +- docs/examples/kotlin/storage/list-buckets.md | 3 +- docs/examples/kotlin/storage/list-files.md | 3 +- docs/examples/kotlin/storage/update-bucket.md | 4 +- docs/examples/kotlin/storage/update-file.md | 4 +- docs/examples/kotlin/tablesdb/create-row.md | 4 +- docs/examples/kotlin/tablesdb/create-table.md | 4 +- docs/examples/kotlin/tablesdb/list-columns.md | 3 +- docs/examples/kotlin/tablesdb/list-indexes.md | 3 +- docs/examples/kotlin/tablesdb/list-rows.md | 3 +- docs/examples/kotlin/tablesdb/list-tables.md | 3 +- docs/examples/kotlin/tablesdb/list.md | 3 +- docs/examples/kotlin/tablesdb/update-row.md | 4 +- docs/examples/kotlin/tablesdb/update-table.md | 4 +- docs/examples/kotlin/tablesdb/upsert-row.md | 4 +- .../examples/kotlin/teams/list-memberships.md | 3 +- docs/examples/kotlin/teams/list.md | 3 +- docs/examples/kotlin/tokens/list.md | 3 +- docs/examples/kotlin/users/list-identities.md | 3 +- docs/examples/kotlin/users/list-logs.md | 3 +- .../examples/kotlin/users/list-memberships.md | 3 +- docs/examples/kotlin/users/list-sessions.md | 3 +- docs/examples/kotlin/users/list-targets.md | 3 +- docs/examples/kotlin/users/list.md | 3 +- src/main/kotlin/io/appwrite/Client.kt | 4 +- src/main/kotlin/io/appwrite/Operator.kt | 130 +++++++++++++++++ src/main/kotlin/io/appwrite/Query.kt | 12 +- .../io/appwrite/enums/ExecutionStatus.kt | 4 +- .../kotlin/io/appwrite/enums/Framework.kt | 2 + .../kotlin/io/appwrite/models/Execution.kt | 2 +- .../kotlin/io/appwrite/services/Account.kt | 6 + .../kotlin/io/appwrite/services/Databases.kt | 18 +++ .../kotlin/io/appwrite/services/Functions.kt | 9 ++ .../kotlin/io/appwrite/services/Messaging.kt | 133 ++++++++++++++++++ src/main/kotlin/io/appwrite/services/Sites.kt | 9 ++ .../kotlin/io/appwrite/services/Storage.kt | 6 + .../kotlin/io/appwrite/services/TablesDb.kt | 18 +++ src/main/kotlin/io/appwrite/services/Teams.kt | 9 ++ .../kotlin/io/appwrite/services/Tokens.kt | 3 + src/main/kotlin/io/appwrite/services/Users.kt | 22 +++ 126 files changed, 684 insertions(+), 78 deletions(-) create mode 100644 docs/examples/java/messaging/create-resend-provider.md create mode 100644 docs/examples/java/messaging/update-resend-provider.md create mode 100644 docs/examples/kotlin/messaging/create-resend-provider.md create mode 100644 docs/examples/kotlin/messaging/update-resend-provider.md create mode 100644 src/main/kotlin/io/appwrite/Operator.kt diff --git a/CHANGELOG.md b/CHANGELOG.md index fe8c8bf..dd56fb6 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # Change Log +## 12.3.0 + +* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance +* Add `Operator` class for atomic modification of rows via update, bulk update, upsert, and bulk upsert operations + ## 12.2.1 * Add transaction support for Databases and TablesDB diff --git a/README.md b/README.md index cbdd21a..f86832c 100644 --- a/README.md +++ b/README.md @@ -39,7 +39,7 @@ repositories { Next, add the dependency to your project's `build.gradle(.kts)` file: ```groovy -implementation("io.appwrite:sdk-for-kotlin:12.2.1") +implementation("io.appwrite:sdk-for-kotlin:12.3.0") ``` ### Maven @@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-kotlin - 12.2.1 + 12.3.0 ``` diff --git a/docs/examples/java/account/list-identities.md b/docs/examples/java/account/list-identities.md index ceb4b30..8d204d5 100644 --- a/docs/examples/java/account/list-identities.md +++ b/docs/examples/java/account/list-identities.md @@ -11,6 +11,7 @@ Account account = new Account(client); account.listIdentities( listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/account/list-logs.md b/docs/examples/java/account/list-logs.md index de22fce..4b301a1 100644 --- a/docs/examples/java/account/list-logs.md +++ b/docs/examples/java/account/list-logs.md @@ -11,6 +11,7 @@ Account account = new Account(client); account.listLogs( listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/create-collection.md b/docs/examples/java/databases/create-collection.md index 8ec51e6..10eed04 100644 --- a/docs/examples/java/databases/create-collection.md +++ b/docs/examples/java/databases/create-collection.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ databases.createCollection( "", // databaseId "", // collectionId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // documentSecurity (optional) false, // enabled (optional) new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/databases/create-document.md b/docs/examples/java/databases/create-document.md index 9c6357d..aa6c9ea 100644 --- a/docs/examples/java/databases/create-document.md +++ b/docs/examples/java/databases/create-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -20,7 +22,7 @@ databases.createDocument( "age" to 30, "isAdmin" to false ), // data - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/list-attributes.md b/docs/examples/java/databases/list-attributes.md index 9681831..b1b3bd1 100644 --- a/docs/examples/java/databases/list-attributes.md +++ b/docs/examples/java/databases/list-attributes.md @@ -13,6 +13,7 @@ databases.listAttributes( "", // databaseId "", // collectionId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/list-collections.md b/docs/examples/java/databases/list-collections.md index 3253447..efb0e7f 100644 --- a/docs/examples/java/databases/list-collections.md +++ b/docs/examples/java/databases/list-collections.md @@ -13,6 +13,7 @@ databases.listCollections( "", // databaseId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/list-documents.md b/docs/examples/java/databases/list-documents.md index 1e84348..472d15b 100644 --- a/docs/examples/java/databases/list-documents.md +++ b/docs/examples/java/databases/list-documents.md @@ -14,6 +14,7 @@ databases.listDocuments( "", // collectionId listOf(), // queries (optional) "", // transactionId (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/list-indexes.md b/docs/examples/java/databases/list-indexes.md index 8c912bb..5715af7 100644 --- a/docs/examples/java/databases/list-indexes.md +++ b/docs/examples/java/databases/list-indexes.md @@ -13,6 +13,7 @@ databases.listIndexes( "", // databaseId "", // collectionId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/list.md b/docs/examples/java/databases/list.md index 758b9f7..a3f2d51 100644 --- a/docs/examples/java/databases/list.md +++ b/docs/examples/java/databases/list.md @@ -12,6 +12,7 @@ Databases databases = new Databases(client); databases.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/databases/update-collection.md b/docs/examples/java/databases/update-collection.md index 6805c11..24d312d 100644 --- a/docs/examples/java/databases/update-collection.md +++ b/docs/examples/java/databases/update-collection.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ databases.updateCollection( "", // databaseId "", // collectionId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // documentSecurity (optional) false, // enabled (optional) new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/databases/update-document.md b/docs/examples/java/databases/update-document.md index f3019ab..749de99 100644 --- a/docs/examples/java/databases/update-document.md +++ b/docs/examples/java/databases/update-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,7 +16,7 @@ databases.updateDocument( "", // collectionId "", // documentId mapOf( "a" to "b" ), // data (optional) - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/databases/upsert-document.md b/docs/examples/java/databases/upsert-document.md index 39864b9..4f156bb 100644 --- a/docs/examples/java/databases/upsert-document.md +++ b/docs/examples/java/databases/upsert-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Databases; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,7 +16,7 @@ databases.upsertDocument( "", // collectionId "", // documentId mapOf( "a" to "b" ), // data - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/functions/list-deployments.md b/docs/examples/java/functions/list-deployments.md index 16a10ca..a0ea8b6 100644 --- a/docs/examples/java/functions/list-deployments.md +++ b/docs/examples/java/functions/list-deployments.md @@ -13,6 +13,7 @@ functions.listDeployments( "", // functionId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/list-executions.md b/docs/examples/java/functions/list-executions.md index 25a9af8..8026d47 100644 --- a/docs/examples/java/functions/list-executions.md +++ b/docs/examples/java/functions/list-executions.md @@ -12,6 +12,7 @@ Functions functions = new Functions(client); functions.listExecutions( "", // functionId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/functions/list.md b/docs/examples/java/functions/list.md index a9a3206..5d0f59c 100644 --- a/docs/examples/java/functions/list.md +++ b/docs/examples/java/functions/list.md @@ -12,6 +12,7 @@ Functions functions = new Functions(client); functions.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/create-resend-provider.md b/docs/examples/java/messaging/create-resend-provider.md new file mode 100644 index 0000000..37681f9 --- /dev/null +++ b/docs/examples/java/messaging/create-resend-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.createResendProvider( + "", // providerId + "", // name + "", // apiKey (optional) + "", // fromName (optional) + "email@example.com", // fromEmail (optional) + "", // replyToName (optional) + "email@example.com", // replyToEmail (optional) + false, // enabled (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/messaging/list-message-logs.md b/docs/examples/java/messaging/list-message-logs.md index 0f94e46..253299c 100644 --- a/docs/examples/java/messaging/list-message-logs.md +++ b/docs/examples/java/messaging/list-message-logs.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listMessageLogs( "", // messageId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-messages.md b/docs/examples/java/messaging/list-messages.md index 006ba7c..6535222 100644 --- a/docs/examples/java/messaging/list-messages.md +++ b/docs/examples/java/messaging/list-messages.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listMessages( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-provider-logs.md b/docs/examples/java/messaging/list-provider-logs.md index 5f77f2d..3bce211 100644 --- a/docs/examples/java/messaging/list-provider-logs.md +++ b/docs/examples/java/messaging/list-provider-logs.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listProviderLogs( "", // providerId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-providers.md b/docs/examples/java/messaging/list-providers.md index b069dda..115cd41 100644 --- a/docs/examples/java/messaging/list-providers.md +++ b/docs/examples/java/messaging/list-providers.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listProviders( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-subscriber-logs.md b/docs/examples/java/messaging/list-subscriber-logs.md index b10e446..e2e1e94 100644 --- a/docs/examples/java/messaging/list-subscriber-logs.md +++ b/docs/examples/java/messaging/list-subscriber-logs.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listSubscriberLogs( "", // subscriberId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-subscribers.md b/docs/examples/java/messaging/list-subscribers.md index 52ca5b0..3b87ed8 100644 --- a/docs/examples/java/messaging/list-subscribers.md +++ b/docs/examples/java/messaging/list-subscribers.md @@ -13,6 +13,7 @@ messaging.listSubscribers( "", // topicId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-targets.md b/docs/examples/java/messaging/list-targets.md index 5b9f40e..db6aee1 100644 --- a/docs/examples/java/messaging/list-targets.md +++ b/docs/examples/java/messaging/list-targets.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listTargets( "", // messageId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-topic-logs.md b/docs/examples/java/messaging/list-topic-logs.md index b2e9444..800bb6b 100644 --- a/docs/examples/java/messaging/list-topic-logs.md +++ b/docs/examples/java/messaging/list-topic-logs.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listTopicLogs( "", // topicId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/list-topics.md b/docs/examples/java/messaging/list-topics.md index e6408a6..bd53b41 100644 --- a/docs/examples/java/messaging/list-topics.md +++ b/docs/examples/java/messaging/list-topics.md @@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client); messaging.listTopics( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/messaging/update-resend-provider.md b/docs/examples/java/messaging/update-resend-provider.md new file mode 100644 index 0000000..3282e5d --- /dev/null +++ b/docs/examples/java/messaging/update-resend-provider.md @@ -0,0 +1,30 @@ +import io.appwrite.Client; +import io.appwrite.coroutines.CoroutineCallback; +import io.appwrite.services.Messaging; + +Client client = new Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey(""); // Your secret API key + +Messaging messaging = new Messaging(client); + +messaging.updateResendProvider( + "", // providerId + "", // name (optional) + false, // enabled (optional) + "", // apiKey (optional) + "", // fromName (optional) + "email@example.com", // fromEmail (optional) + "", // replyToName (optional) + "", // replyToEmail (optional) + new CoroutineCallback<>((result, error) -> { + if (error != null) { + error.printStackTrace(); + return; + } + + System.out.println(result); + }) +); + diff --git a/docs/examples/java/sites/list-deployments.md b/docs/examples/java/sites/list-deployments.md index 8bcec54..a19f4ec 100644 --- a/docs/examples/java/sites/list-deployments.md +++ b/docs/examples/java/sites/list-deployments.md @@ -13,6 +13,7 @@ sites.listDeployments( "", // siteId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/sites/list-logs.md b/docs/examples/java/sites/list-logs.md index 3532882..85c2171 100644 --- a/docs/examples/java/sites/list-logs.md +++ b/docs/examples/java/sites/list-logs.md @@ -12,6 +12,7 @@ Sites sites = new Sites(client); sites.listLogs( "", // siteId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/sites/list.md b/docs/examples/java/sites/list.md index 39a1c06..20b5533 100644 --- a/docs/examples/java/sites/list.md +++ b/docs/examples/java/sites/list.md @@ -12,6 +12,7 @@ Sites sites = new Sites(client); sites.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/create-bucket.md b/docs/examples/java/storage/create-bucket.md index a3a3308..d48db24 100644 --- a/docs/examples/java/storage/create-bucket.md +++ b/docs/examples/java/storage/create-bucket.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -12,7 +14,7 @@ Storage storage = new Storage(client); storage.createBucket( "", // bucketId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // fileSecurity (optional) false, // enabled (optional) 1, // maximumFileSize (optional) diff --git a/docs/examples/java/storage/create-file.md b/docs/examples/java/storage/create-file.md index 583f856..7ddf891 100644 --- a/docs/examples/java/storage/create-file.md +++ b/docs/examples/java/storage/create-file.md @@ -2,6 +2,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.models.InputFile; import io.appwrite.services.Storage; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,7 +16,7 @@ storage.createFile( "", // bucketId "", // fileId InputFile.fromPath("file.png"), // file - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/list-buckets.md b/docs/examples/java/storage/list-buckets.md index 9d85957..504cfb7 100644 --- a/docs/examples/java/storage/list-buckets.md +++ b/docs/examples/java/storage/list-buckets.md @@ -12,6 +12,7 @@ Storage storage = new Storage(client); storage.listBuckets( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/list-files.md b/docs/examples/java/storage/list-files.md index f002754..6397ca0 100644 --- a/docs/examples/java/storage/list-files.md +++ b/docs/examples/java/storage/list-files.md @@ -13,6 +13,7 @@ storage.listFiles( "", // bucketId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/storage/update-bucket.md b/docs/examples/java/storage/update-bucket.md index 2d80e26..586b113 100644 --- a/docs/examples/java/storage/update-bucket.md +++ b/docs/examples/java/storage/update-bucket.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -12,7 +14,7 @@ Storage storage = new Storage(client); storage.updateBucket( "", // bucketId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // fileSecurity (optional) false, // enabled (optional) 1, // maximumFileSize (optional) diff --git a/docs/examples/java/storage/update-file.md b/docs/examples/java/storage/update-file.md index 7f325f9..d534e0e 100644 --- a/docs/examples/java/storage/update-file.md +++ b/docs/examples/java/storage/update-file.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.Storage; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ storage.updateFile( "", // bucketId "", // fileId "", // name (optional) - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/create-row.md b/docs/examples/java/tablesdb/create-row.md index d041511..9e47167 100644 --- a/docs/examples/java/tablesdb/create-row.md +++ b/docs/examples/java/tablesdb/create-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -20,7 +22,7 @@ tablesDB.createRow( "age" to 30, "isAdmin" to false ), // data - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/tablesdb/create-table.md b/docs/examples/java/tablesdb/create-table.md index 5bd3b6d..1f9fd10 100644 --- a/docs/examples/java/tablesdb/create-table.md +++ b/docs/examples/java/tablesdb/create-table.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ tablesDB.createTable( "", // databaseId "", // tableId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // rowSecurity (optional) false, // enabled (optional) new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/tablesdb/list-columns.md b/docs/examples/java/tablesdb/list-columns.md index f0e70d3..bdf376c 100644 --- a/docs/examples/java/tablesdb/list-columns.md +++ b/docs/examples/java/tablesdb/list-columns.md @@ -13,6 +13,7 @@ tablesDB.listColumns( "", // databaseId "", // tableId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/list-indexes.md b/docs/examples/java/tablesdb/list-indexes.md index 1e5d1f9..5b73204 100644 --- a/docs/examples/java/tablesdb/list-indexes.md +++ b/docs/examples/java/tablesdb/list-indexes.md @@ -13,6 +13,7 @@ tablesDB.listIndexes( "", // databaseId "", // tableId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/list-rows.md b/docs/examples/java/tablesdb/list-rows.md index 96520e2..8d7956b 100644 --- a/docs/examples/java/tablesdb/list-rows.md +++ b/docs/examples/java/tablesdb/list-rows.md @@ -14,6 +14,7 @@ tablesDB.listRows( "", // tableId listOf(), // queries (optional) "", // transactionId (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/list-tables.md b/docs/examples/java/tablesdb/list-tables.md index 5e98cb6..646be0f 100644 --- a/docs/examples/java/tablesdb/list-tables.md +++ b/docs/examples/java/tablesdb/list-tables.md @@ -13,6 +13,7 @@ tablesDB.listTables( "", // databaseId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/list.md b/docs/examples/java/tablesdb/list.md index 34dc9da..98784df 100644 --- a/docs/examples/java/tablesdb/list.md +++ b/docs/examples/java/tablesdb/list.md @@ -12,6 +12,7 @@ TablesDB tablesDB = new TablesDB(client); tablesDB.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tablesdb/update-row.md b/docs/examples/java/tablesdb/update-row.md index b4f9631..835f63b 100644 --- a/docs/examples/java/tablesdb/update-row.md +++ b/docs/examples/java/tablesdb/update-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,7 +16,7 @@ tablesDB.updateRow( "", // tableId "", // rowId mapOf( "a" to "b" ), // data (optional) - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/tablesdb/update-table.md b/docs/examples/java/tablesdb/update-table.md index e593a04..257803b 100644 --- a/docs/examples/java/tablesdb/update-table.md +++ b/docs/examples/java/tablesdb/update-table.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ tablesDB.updateTable( "", // databaseId "", // tableId "", // name - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) false, // rowSecurity (optional) false, // enabled (optional) new CoroutineCallback<>((result, error) -> { diff --git a/docs/examples/java/tablesdb/upsert-row.md b/docs/examples/java/tablesdb/upsert-row.md index b6a986e..6ea29e3 100644 --- a/docs/examples/java/tablesdb/upsert-row.md +++ b/docs/examples/java/tablesdb/upsert-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client; import io.appwrite.coroutines.CoroutineCallback; import io.appwrite.services.TablesDB; +import io.appwrite.Permission; +import io.appwrite.Role; Client client = new Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,7 +16,7 @@ tablesDB.upsertRow( "", // tableId "", // rowId mapOf( "a" to "b" ), // data (optional) - listOf("read("any")"), // permissions (optional) + listOf(Permission.read(Role.any())), // permissions (optional) "", // transactionId (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { diff --git a/docs/examples/java/teams/list-memberships.md b/docs/examples/java/teams/list-memberships.md index 9694482..bfbf519 100644 --- a/docs/examples/java/teams/list-memberships.md +++ b/docs/examples/java/teams/list-memberships.md @@ -13,6 +13,7 @@ teams.listMemberships( "", // teamId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/teams/list.md b/docs/examples/java/teams/list.md index d0855ba..7ff98ad 100644 --- a/docs/examples/java/teams/list.md +++ b/docs/examples/java/teams/list.md @@ -12,6 +12,7 @@ Teams teams = new Teams(client); teams.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/tokens/list.md b/docs/examples/java/tokens/list.md index a59e9f5..23c51a6 100644 --- a/docs/examples/java/tokens/list.md +++ b/docs/examples/java/tokens/list.md @@ -13,6 +13,7 @@ tokens.list( "", // bucketId "", // fileId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-identities.md b/docs/examples/java/users/list-identities.md index e0fc9d1..fc95c8e 100644 --- a/docs/examples/java/users/list-identities.md +++ b/docs/examples/java/users/list-identities.md @@ -12,6 +12,7 @@ Users users = new Users(client); users.listIdentities( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-logs.md b/docs/examples/java/users/list-logs.md index 86c94ee..4a2e549 100644 --- a/docs/examples/java/users/list-logs.md +++ b/docs/examples/java/users/list-logs.md @@ -12,6 +12,7 @@ Users users = new Users(client); users.listLogs( "", // userId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-memberships.md b/docs/examples/java/users/list-memberships.md index d0cee13..36e67ae 100644 --- a/docs/examples/java/users/list-memberships.md +++ b/docs/examples/java/users/list-memberships.md @@ -13,6 +13,7 @@ users.listMemberships( "", // userId listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-sessions.md b/docs/examples/java/users/list-sessions.md index 7e13cb3..d3b24e5 100644 --- a/docs/examples/java/users/list-sessions.md +++ b/docs/examples/java/users/list-sessions.md @@ -11,6 +11,7 @@ Users users = new Users(client); users.listSessions( "", // userId + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list-targets.md b/docs/examples/java/users/list-targets.md index efa7542..156aaef 100644 --- a/docs/examples/java/users/list-targets.md +++ b/docs/examples/java/users/list-targets.md @@ -12,6 +12,7 @@ Users users = new Users(client); users.listTargets( "", // userId listOf(), // queries (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/java/users/list.md b/docs/examples/java/users/list.md index d587eaf..ec038af 100644 --- a/docs/examples/java/users/list.md +++ b/docs/examples/java/users/list.md @@ -12,6 +12,7 @@ Users users = new Users(client); users.list( listOf(), // queries (optional) "", // search (optional) + false, // total (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/kotlin/account/list-identities.md b/docs/examples/kotlin/account/list-identities.md index 32eb86c..874ee8f 100644 --- a/docs/examples/kotlin/account/list-identities.md +++ b/docs/examples/kotlin/account/list-identities.md @@ -10,5 +10,6 @@ val client = Client() val account = Account(client) val response = account.listIdentities( - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/account/list-logs.md b/docs/examples/kotlin/account/list-logs.md index 345b2f1..db0917b 100644 --- a/docs/examples/kotlin/account/list-logs.md +++ b/docs/examples/kotlin/account/list-logs.md @@ -10,5 +10,6 @@ val client = Client() val account = Account(client) val response = account.listLogs( - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/create-collection.md b/docs/examples/kotlin/databases/create-collection.md index de9679f..43031b4 100644 --- a/docs/examples/kotlin/databases/create-collection.md +++ b/docs/examples/kotlin/databases/create-collection.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ val response = databases.createCollection( databaseId = "", collectionId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional documentSecurity = false, // optional enabled = false // optional ) diff --git a/docs/examples/kotlin/databases/create-document.md b/docs/examples/kotlin/databases/create-document.md index 46cb711..cbdbcae 100644 --- a/docs/examples/kotlin/databases/create-document.md +++ b/docs/examples/kotlin/databases/create-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -20,6 +22,6 @@ val response = databases.createDocument( "age" to 30, "isAdmin" to false ), - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/databases/list-attributes.md b/docs/examples/kotlin/databases/list-attributes.md index 5ddb0a6..c2a3e66 100644 --- a/docs/examples/kotlin/databases/list-attributes.md +++ b/docs/examples/kotlin/databases/list-attributes.md @@ -12,5 +12,6 @@ val databases = Databases(client) val response = databases.listAttributes( databaseId = "", collectionId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/list-collections.md b/docs/examples/kotlin/databases/list-collections.md index 5340903..2a646c7 100644 --- a/docs/examples/kotlin/databases/list-collections.md +++ b/docs/examples/kotlin/databases/list-collections.md @@ -12,5 +12,6 @@ val databases = Databases(client) val response = databases.listCollections( databaseId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/list-documents.md b/docs/examples/kotlin/databases/list-documents.md index ab75493..61a3729 100644 --- a/docs/examples/kotlin/databases/list-documents.md +++ b/docs/examples/kotlin/databases/list-documents.md @@ -13,5 +13,6 @@ val response = databases.listDocuments( databaseId = "", collectionId = "", queries = listOf(), // optional - transactionId = "" // optional + transactionId = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/list-indexes.md b/docs/examples/kotlin/databases/list-indexes.md index 2ab2e6a..a324282 100644 --- a/docs/examples/kotlin/databases/list-indexes.md +++ b/docs/examples/kotlin/databases/list-indexes.md @@ -12,5 +12,6 @@ val databases = Databases(client) val response = databases.listIndexes( databaseId = "", collectionId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/list.md b/docs/examples/kotlin/databases/list.md index cd61a0e..a12b54c 100644 --- a/docs/examples/kotlin/databases/list.md +++ b/docs/examples/kotlin/databases/list.md @@ -11,5 +11,6 @@ val databases = Databases(client) val response = databases.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/databases/update-collection.md b/docs/examples/kotlin/databases/update-collection.md index bd42ba0..f37b71a 100644 --- a/docs/examples/kotlin/databases/update-collection.md +++ b/docs/examples/kotlin/databases/update-collection.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ val response = databases.updateCollection( databaseId = "", collectionId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional documentSecurity = false, // optional enabled = false // optional ) diff --git a/docs/examples/kotlin/databases/update-document.md b/docs/examples/kotlin/databases/update-document.md index c64a705..399dfcd 100644 --- a/docs/examples/kotlin/databases/update-document.md +++ b/docs/examples/kotlin/databases/update-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,6 +16,6 @@ val response = databases.updateDocument( collectionId = "", documentId = "", data = mapOf( "a" to "b" ), // optional - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/databases/upsert-document.md b/docs/examples/kotlin/databases/upsert-document.md index d6d6800..8387398 100644 --- a/docs/examples/kotlin/databases/upsert-document.md +++ b/docs/examples/kotlin/databases/upsert-document.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Databases +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,6 +16,6 @@ val response = databases.upsertDocument( collectionId = "", documentId = "", data = mapOf( "a" to "b" ), - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/functions/list-deployments.md b/docs/examples/kotlin/functions/list-deployments.md index 9318442..63f4850 100644 --- a/docs/examples/kotlin/functions/list-deployments.md +++ b/docs/examples/kotlin/functions/list-deployments.md @@ -12,5 +12,6 @@ val functions = Functions(client) val response = functions.listDeployments( functionId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/functions/list-executions.md b/docs/examples/kotlin/functions/list-executions.md index 926719c..75fc51e 100644 --- a/docs/examples/kotlin/functions/list-executions.md +++ b/docs/examples/kotlin/functions/list-executions.md @@ -11,5 +11,6 @@ val functions = Functions(client) val response = functions.listExecutions( functionId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/functions/list.md b/docs/examples/kotlin/functions/list.md index b10fdff..4cf8518 100644 --- a/docs/examples/kotlin/functions/list.md +++ b/docs/examples/kotlin/functions/list.md @@ -11,5 +11,6 @@ val functions = Functions(client) val response = functions.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/create-resend-provider.md b/docs/examples/kotlin/messaging/create-resend-provider.md new file mode 100644 index 0000000..2db1dc1 --- /dev/null +++ b/docs/examples/kotlin/messaging/create-resend-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.createResendProvider( + providerId = "", + name = "", + apiKey = "", // optional + fromName = "", // optional + fromEmail = "email@example.com", // optional + replyToName = "", // optional + replyToEmail = "email@example.com", // optional + enabled = false // optional +) diff --git a/docs/examples/kotlin/messaging/list-message-logs.md b/docs/examples/kotlin/messaging/list-message-logs.md index e1463f8..2f03870 100644 --- a/docs/examples/kotlin/messaging/list-message-logs.md +++ b/docs/examples/kotlin/messaging/list-message-logs.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listMessageLogs( messageId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-messages.md b/docs/examples/kotlin/messaging/list-messages.md index 618f8c4..22aae7e 100644 --- a/docs/examples/kotlin/messaging/list-messages.md +++ b/docs/examples/kotlin/messaging/list-messages.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listMessages( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-provider-logs.md b/docs/examples/kotlin/messaging/list-provider-logs.md index ab0a9f1..2f7eb72 100644 --- a/docs/examples/kotlin/messaging/list-provider-logs.md +++ b/docs/examples/kotlin/messaging/list-provider-logs.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listProviderLogs( providerId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-providers.md b/docs/examples/kotlin/messaging/list-providers.md index 34c70a9..5c200e7 100644 --- a/docs/examples/kotlin/messaging/list-providers.md +++ b/docs/examples/kotlin/messaging/list-providers.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listProviders( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-subscriber-logs.md b/docs/examples/kotlin/messaging/list-subscriber-logs.md index 8a82af8..f7c9324 100644 --- a/docs/examples/kotlin/messaging/list-subscriber-logs.md +++ b/docs/examples/kotlin/messaging/list-subscriber-logs.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listSubscriberLogs( subscriberId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-subscribers.md b/docs/examples/kotlin/messaging/list-subscribers.md index acf5249..0056974 100644 --- a/docs/examples/kotlin/messaging/list-subscribers.md +++ b/docs/examples/kotlin/messaging/list-subscribers.md @@ -12,5 +12,6 @@ val messaging = Messaging(client) val response = messaging.listSubscribers( topicId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-targets.md b/docs/examples/kotlin/messaging/list-targets.md index ad500f0..2611fc9 100644 --- a/docs/examples/kotlin/messaging/list-targets.md +++ b/docs/examples/kotlin/messaging/list-targets.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listTargets( messageId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-topic-logs.md b/docs/examples/kotlin/messaging/list-topic-logs.md index 683b418..c7e81b2 100644 --- a/docs/examples/kotlin/messaging/list-topic-logs.md +++ b/docs/examples/kotlin/messaging/list-topic-logs.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listTopicLogs( topicId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/list-topics.md b/docs/examples/kotlin/messaging/list-topics.md index 125c6ff..a2c64e6 100644 --- a/docs/examples/kotlin/messaging/list-topics.md +++ b/docs/examples/kotlin/messaging/list-topics.md @@ -11,5 +11,6 @@ val messaging = Messaging(client) val response = messaging.listTopics( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/messaging/update-resend-provider.md b/docs/examples/kotlin/messaging/update-resend-provider.md new file mode 100644 index 0000000..26d6f12 --- /dev/null +++ b/docs/examples/kotlin/messaging/update-resend-provider.md @@ -0,0 +1,21 @@ +import io.appwrite.Client +import io.appwrite.coroutines.CoroutineCallback +import io.appwrite.services.Messaging + +val client = Client() + .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint + .setProject("") // Your project ID + .setKey("") // Your secret API key + +val messaging = Messaging(client) + +val response = messaging.updateResendProvider( + providerId = "", + name = "", // optional + enabled = false, // optional + apiKey = "", // optional + fromName = "", // optional + fromEmail = "email@example.com", // optional + replyToName = "", // optional + replyToEmail = "" // optional +) diff --git a/docs/examples/kotlin/sites/list-deployments.md b/docs/examples/kotlin/sites/list-deployments.md index 6bc29cc..5115297 100644 --- a/docs/examples/kotlin/sites/list-deployments.md +++ b/docs/examples/kotlin/sites/list-deployments.md @@ -12,5 +12,6 @@ val sites = Sites(client) val response = sites.listDeployments( siteId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/sites/list-logs.md b/docs/examples/kotlin/sites/list-logs.md index d7979de..95848b2 100644 --- a/docs/examples/kotlin/sites/list-logs.md +++ b/docs/examples/kotlin/sites/list-logs.md @@ -11,5 +11,6 @@ val sites = Sites(client) val response = sites.listLogs( siteId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/sites/list.md b/docs/examples/kotlin/sites/list.md index 26e9651..844823d 100644 --- a/docs/examples/kotlin/sites/list.md +++ b/docs/examples/kotlin/sites/list.md @@ -11,5 +11,6 @@ val sites = Sites(client) val response = sites.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/storage/create-bucket.md b/docs/examples/kotlin/storage/create-bucket.md index 0bca827..872932e 100644 --- a/docs/examples/kotlin/storage/create-bucket.md +++ b/docs/examples/kotlin/storage/create-bucket.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -12,7 +14,7 @@ val storage = Storage(client) val response = storage.createBucket( bucketId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional fileSecurity = false, // optional enabled = false, // optional maximumFileSize = 1, // optional diff --git a/docs/examples/kotlin/storage/create-file.md b/docs/examples/kotlin/storage/create-file.md index b22b32a..e9e986c 100644 --- a/docs/examples/kotlin/storage/create-file.md +++ b/docs/examples/kotlin/storage/create-file.md @@ -2,6 +2,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.models.InputFile import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,5 +16,5 @@ val response = storage.createFile( bucketId = "", fileId = "", file = InputFile.fromPath("file.png"), - permissions = listOf("read("any")") // optional + permissions = listOf(Permission.read(Role.any())) // optional ) diff --git a/docs/examples/kotlin/storage/list-buckets.md b/docs/examples/kotlin/storage/list-buckets.md index a8a066d..b502367 100644 --- a/docs/examples/kotlin/storage/list-buckets.md +++ b/docs/examples/kotlin/storage/list-buckets.md @@ -11,5 +11,6 @@ val storage = Storage(client) val response = storage.listBuckets( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/storage/list-files.md b/docs/examples/kotlin/storage/list-files.md index cb9a776..648d37d 100644 --- a/docs/examples/kotlin/storage/list-files.md +++ b/docs/examples/kotlin/storage/list-files.md @@ -12,5 +12,6 @@ val storage = Storage(client) val response = storage.listFiles( bucketId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/storage/update-bucket.md b/docs/examples/kotlin/storage/update-bucket.md index d475a6e..cb81873 100644 --- a/docs/examples/kotlin/storage/update-bucket.md +++ b/docs/examples/kotlin/storage/update-bucket.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -12,7 +14,7 @@ val storage = Storage(client) val response = storage.updateBucket( bucketId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional fileSecurity = false, // optional enabled = false, // optional maximumFileSize = 1, // optional diff --git a/docs/examples/kotlin/storage/update-file.md b/docs/examples/kotlin/storage/update-file.md index e82ea81..b019f56 100644 --- a/docs/examples/kotlin/storage/update-file.md +++ b/docs/examples/kotlin/storage/update-file.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.Storage +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,5 +15,5 @@ val response = storage.updateFile( bucketId = "", fileId = "", name = "", // optional - permissions = listOf("read("any")") // optional + permissions = listOf(Permission.read(Role.any())) // optional ) diff --git a/docs/examples/kotlin/tablesdb/create-row.md b/docs/examples/kotlin/tablesdb/create-row.md index b060389..e74c07a 100644 --- a/docs/examples/kotlin/tablesdb/create-row.md +++ b/docs/examples/kotlin/tablesdb/create-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -20,6 +22,6 @@ val response = tablesDB.createRow( "age" to 30, "isAdmin" to false ), - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/tablesdb/create-table.md b/docs/examples/kotlin/tablesdb/create-table.md index 88b50d2..5ff2ba4 100644 --- a/docs/examples/kotlin/tablesdb/create-table.md +++ b/docs/examples/kotlin/tablesdb/create-table.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ val response = tablesDB.createTable( databaseId = "", tableId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional rowSecurity = false, // optional enabled = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/list-columns.md b/docs/examples/kotlin/tablesdb/list-columns.md index 85a9aab..663da3c 100644 --- a/docs/examples/kotlin/tablesdb/list-columns.md +++ b/docs/examples/kotlin/tablesdb/list-columns.md @@ -12,5 +12,6 @@ val tablesDB = TablesDB(client) val response = tablesDB.listColumns( databaseId = "", tableId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/list-indexes.md b/docs/examples/kotlin/tablesdb/list-indexes.md index db5aad4..59a64a4 100644 --- a/docs/examples/kotlin/tablesdb/list-indexes.md +++ b/docs/examples/kotlin/tablesdb/list-indexes.md @@ -12,5 +12,6 @@ val tablesDB = TablesDB(client) val response = tablesDB.listIndexes( databaseId = "", tableId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/list-rows.md b/docs/examples/kotlin/tablesdb/list-rows.md index 711e4e1..ba6e1fe 100644 --- a/docs/examples/kotlin/tablesdb/list-rows.md +++ b/docs/examples/kotlin/tablesdb/list-rows.md @@ -13,5 +13,6 @@ val response = tablesDB.listRows( databaseId = "", tableId = "", queries = listOf(), // optional - transactionId = "" // optional + transactionId = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/list-tables.md b/docs/examples/kotlin/tablesdb/list-tables.md index 1e8eb8f..c504d73 100644 --- a/docs/examples/kotlin/tablesdb/list-tables.md +++ b/docs/examples/kotlin/tablesdb/list-tables.md @@ -12,5 +12,6 @@ val tablesDB = TablesDB(client) val response = tablesDB.listTables( databaseId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/list.md b/docs/examples/kotlin/tablesdb/list.md index 58b48a0..942880c 100644 --- a/docs/examples/kotlin/tablesdb/list.md +++ b/docs/examples/kotlin/tablesdb/list.md @@ -11,5 +11,6 @@ val tablesDB = TablesDB(client) val response = tablesDB.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/update-row.md b/docs/examples/kotlin/tablesdb/update-row.md index 0fefb78..94f3770 100644 --- a/docs/examples/kotlin/tablesdb/update-row.md +++ b/docs/examples/kotlin/tablesdb/update-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,6 +16,6 @@ val response = tablesDB.updateRow( tableId = "", rowId = "", data = mapOf( "a" to "b" ), // optional - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/tablesdb/update-table.md b/docs/examples/kotlin/tablesdb/update-table.md index 5238908..357d5b9 100644 --- a/docs/examples/kotlin/tablesdb/update-table.md +++ b/docs/examples/kotlin/tablesdb/update-table.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -13,7 +15,7 @@ val response = tablesDB.updateTable( databaseId = "", tableId = "", name = "", - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional rowSecurity = false, // optional enabled = false // optional ) diff --git a/docs/examples/kotlin/tablesdb/upsert-row.md b/docs/examples/kotlin/tablesdb/upsert-row.md index 5bcc73b..b72ab80 100644 --- a/docs/examples/kotlin/tablesdb/upsert-row.md +++ b/docs/examples/kotlin/tablesdb/upsert-row.md @@ -1,6 +1,8 @@ import io.appwrite.Client import io.appwrite.coroutines.CoroutineCallback import io.appwrite.services.TablesDB +import io.appwrite.Permission +import io.appwrite.Role val client = Client() .setEndpoint("https://.cloud.appwrite.io/v1") // Your API Endpoint @@ -14,6 +16,6 @@ val response = tablesDB.upsertRow( tableId = "", rowId = "", data = mapOf( "a" to "b" ), // optional - permissions = listOf("read("any")"), // optional + permissions = listOf(Permission.read(Role.any())), // optional transactionId = "" // optional ) diff --git a/docs/examples/kotlin/teams/list-memberships.md b/docs/examples/kotlin/teams/list-memberships.md index 2870873..edcbd0d 100644 --- a/docs/examples/kotlin/teams/list-memberships.md +++ b/docs/examples/kotlin/teams/list-memberships.md @@ -12,5 +12,6 @@ val teams = Teams(client) val response = teams.listMemberships( teamId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/teams/list.md b/docs/examples/kotlin/teams/list.md index ee3e3e4..591efa4 100644 --- a/docs/examples/kotlin/teams/list.md +++ b/docs/examples/kotlin/teams/list.md @@ -11,5 +11,6 @@ val teams = Teams(client) val response = teams.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/tokens/list.md b/docs/examples/kotlin/tokens/list.md index 6975790..01f369d 100644 --- a/docs/examples/kotlin/tokens/list.md +++ b/docs/examples/kotlin/tokens/list.md @@ -12,5 +12,6 @@ val tokens = Tokens(client) val response = tokens.list( bucketId = "", fileId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/users/list-identities.md b/docs/examples/kotlin/users/list-identities.md index 1ac0e5b..f7cc447 100644 --- a/docs/examples/kotlin/users/list-identities.md +++ b/docs/examples/kotlin/users/list-identities.md @@ -11,5 +11,6 @@ val users = Users(client) val response = users.listIdentities( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/users/list-logs.md b/docs/examples/kotlin/users/list-logs.md index a263293..3e8bfa3 100644 --- a/docs/examples/kotlin/users/list-logs.md +++ b/docs/examples/kotlin/users/list-logs.md @@ -11,5 +11,6 @@ val users = Users(client) val response = users.listLogs( userId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/users/list-memberships.md b/docs/examples/kotlin/users/list-memberships.md index 7df13df..b2f87b3 100644 --- a/docs/examples/kotlin/users/list-memberships.md +++ b/docs/examples/kotlin/users/list-memberships.md @@ -12,5 +12,6 @@ val users = Users(client) val response = users.listMemberships( userId = "", queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/docs/examples/kotlin/users/list-sessions.md b/docs/examples/kotlin/users/list-sessions.md index 4ff34dd..9231c01 100644 --- a/docs/examples/kotlin/users/list-sessions.md +++ b/docs/examples/kotlin/users/list-sessions.md @@ -10,5 +10,6 @@ val client = Client() val users = Users(client) val response = users.listSessions( - userId = "" + userId = "", + total = false // optional ) diff --git a/docs/examples/kotlin/users/list-targets.md b/docs/examples/kotlin/users/list-targets.md index 0824acf..133161f 100644 --- a/docs/examples/kotlin/users/list-targets.md +++ b/docs/examples/kotlin/users/list-targets.md @@ -11,5 +11,6 @@ val users = Users(client) val response = users.listTargets( userId = "", - queries = listOf() // optional + queries = listOf(), // optional + total = false // optional ) diff --git a/docs/examples/kotlin/users/list.md b/docs/examples/kotlin/users/list.md index 23dd217..a2a7b6e 100644 --- a/docs/examples/kotlin/users/list.md +++ b/docs/examples/kotlin/users/list.md @@ -11,5 +11,6 @@ val users = Users(client) val response = users.list( queries = listOf(), // optional - search = "" // optional + search = "", // optional + total = false // optional ) diff --git a/src/main/kotlin/io/appwrite/Client.kt b/src/main/kotlin/io/appwrite/Client.kt index 5e169ba..1ad2434 100644 --- a/src/main/kotlin/io/appwrite/Client.kt +++ b/src/main/kotlin/io/appwrite/Client.kt @@ -58,11 +58,11 @@ class Client @JvmOverloads constructor( init { headers = mutableMapOf( "content-type" to "application/json", - "user-agent" to "AppwriteKotlinSDK/12.2.1 ${System.getProperty("http.agent")}", + "user-agent" to "AppwriteKotlinSDK/12.3.0 ${System.getProperty("http.agent")}", "x-sdk-name" to "Kotlin", "x-sdk-platform" to "server", "x-sdk-language" to "kotlin", - "x-sdk-version" to "12.2.1", + "x-sdk-version" to "12.3.0", "x-appwrite-response-format" to "1.8.0", ) diff --git a/src/main/kotlin/io/appwrite/Operator.kt b/src/main/kotlin/io/appwrite/Operator.kt new file mode 100644 index 0000000..578dc08 --- /dev/null +++ b/src/main/kotlin/io/appwrite/Operator.kt @@ -0,0 +1,130 @@ +package io.appwrite + +import io.appwrite.extensions.toJson + +enum class Condition(val value: String) { + EQUAL("equal"), + NOT_EQUAL("notEqual"), + GREATER_THAN("greaterThan"), + GREATER_THAN_EQUAL("greaterThanEqual"), + LESS_THAN("lessThan"), + LESS_THAN_EQUAL("lessThanEqual"), + CONTAINS("contains"), + IS_NULL("isNull"), + IS_NOT_NULL("isNotNull"); + + override fun toString() = value +} + +class Operator( + val method: String, + val values: List? = null, +) { + override fun toString() = this.toJson() + + companion object { + fun increment(value: Number = 1, max: Number? = null): String { + require(!value.toDouble().isNaN() && !value.toDouble().isInfinite()) { "Value cannot be NaN or Infinity" } + max?.let { require(!it.toDouble().isNaN() && !it.toDouble().isInfinite()) { "Max cannot be NaN or Infinity" } } + val values = mutableListOf(value) + max?.let { values.add(it) } + return Operator("increment", values).toJson() + } + + fun decrement(value: Number = 1, min: Number? = null): String { + require(!value.toDouble().isNaN() && !value.toDouble().isInfinite()) { "Value cannot be NaN or Infinity" } + min?.let { require(!it.toDouble().isNaN() && !it.toDouble().isInfinite()) { "Min cannot be NaN or Infinity" } } + val values = mutableListOf(value) + min?.let { values.add(it) } + return Operator("decrement", values).toJson() + } + + fun multiply(factor: Number, max: Number? = null): String { + require(!factor.toDouble().isNaN() && !factor.toDouble().isInfinite()) { "Factor cannot be NaN or Infinity" } + max?.let { require(!it.toDouble().isNaN() && !it.toDouble().isInfinite()) { "Max cannot be NaN or Infinity" } } + val values = mutableListOf(factor) + max?.let { values.add(it) } + return Operator("multiply", values).toJson() + } + + fun divide(divisor: Number, min: Number? = null): String { + require(!divisor.toDouble().isNaN() && !divisor.toDouble().isInfinite()) { "Divisor cannot be NaN or Infinity" } + min?.let { require(!it.toDouble().isNaN() && !it.toDouble().isInfinite()) { "Min cannot be NaN or Infinity" } } + require(divisor.toDouble() != 0.0) { "Divisor cannot be zero" } + val values = mutableListOf(divisor) + min?.let { values.add(it) } + return Operator("divide", values).toJson() + } + + fun modulo(divisor: Number): String { + require(!divisor.toDouble().isNaN() && !divisor.toDouble().isInfinite()) { "Divisor cannot be NaN or Infinity" } + require(divisor.toDouble() != 0.0) { "Divisor cannot be zero" } + return Operator("modulo", listOf(divisor)).toJson() + } + + fun power(exponent: Number, max: Number? = null): String { + require(!exponent.toDouble().isNaN() && !exponent.toDouble().isInfinite()) { "Exponent cannot be NaN or Infinity" } + max?.let { require(!it.toDouble().isNaN() && !it.toDouble().isInfinite()) { "Max cannot be NaN or Infinity" } } + val values = mutableListOf(exponent) + max?.let { values.add(it) } + return Operator("power", values).toJson() + } + + fun arrayAppend(values: List): String { + return Operator("arrayAppend", values).toJson() + } + + fun arrayPrepend(values: List): String { + return Operator("arrayPrepend", values).toJson() + } + + fun arrayInsert(index: Int, value: Any): String { + return Operator("arrayInsert", listOf(index, value)).toJson() + } + + fun arrayRemove(value: Any): String { + return Operator("arrayRemove", listOf(value)).toJson() + } + + fun arrayUnique(): String { + return Operator("arrayUnique", emptyList()).toJson() + } + + fun arrayIntersect(values: List): String { + return Operator("arrayIntersect", values).toJson() + } + + fun arrayDiff(values: List): String { + return Operator("arrayDiff", values).toJson() + } + + fun arrayFilter(condition: Condition, value: Any? = null): String { + val values = listOf(condition.value, value) + return Operator("arrayFilter", values).toJson() + } + + fun stringConcat(value: Any): String { + return Operator("stringConcat", listOf(value)).toJson() + } + + fun stringReplace(search: String, replace: String): String { + return Operator("stringReplace", listOf(search, replace)).toJson() + } + + fun toggle(): String { + return Operator("toggle", emptyList()).toJson() + } + + fun dateAddDays(days: Int): String { + return Operator("dateAddDays", listOf(days)).toJson() + } + + fun dateSubDays(days: Int): String { + return Operator("dateSubDays", listOf(days)).toJson() + } + + fun dateSetNow(): String { + return Operator("dateSetNow", emptyList()).toJson() + } + } +} diff --git a/src/main/kotlin/io/appwrite/Query.kt b/src/main/kotlin/io/appwrite/Query.kt index 717425c..421dcf9 100644 --- a/src/main/kotlin/io/appwrite/Query.kt +++ b/src/main/kotlin/io/appwrite/Query.kt @@ -63,17 +63,17 @@ class Query( fun notEndsWith(attribute: String, value: String) = Query("notEndsWith", attribute, listOf(value)).toJson() - fun createdBefore(value: String) = Query("createdBefore", null, listOf(value)).toJson() + fun createdBefore(value: String) = lessThan("\$createdAt", value) - fun createdAfter(value: String) = Query("createdAfter", null, listOf(value)).toJson() + fun createdAfter(value: String) = greaterThan("\$createdAt", value) - fun createdBetween(start: String, end: String) = Query("createdBetween", null, listOf(start, end)).toJson() + fun createdBetween(start: String, end: String) = between("\$createdAt", start, end) - fun updatedBefore(value: String) = Query("updatedBefore", null, listOf(value)).toJson() + fun updatedBefore(value: String) = lessThan("\$updatedAt", value) - fun updatedAfter(value: String) = Query("updatedAfter", null, listOf(value)).toJson() + fun updatedAfter(value: String) = greaterThan("\$updatedAt", value) - fun updatedBetween(start: String, end: String) = Query("updatedBetween", null, listOf(start, end)).toJson() + fun updatedBetween(start: String, end: String) = between("\$updatedAt", start, end) fun or(queries: List) = Query("or", null, queries.map { it.fromJson() }).toJson() diff --git a/src/main/kotlin/io/appwrite/enums/ExecutionStatus.kt b/src/main/kotlin/io/appwrite/enums/ExecutionStatus.kt index 6944c55..25a1412 100644 --- a/src/main/kotlin/io/appwrite/enums/ExecutionStatus.kt +++ b/src/main/kotlin/io/appwrite/enums/ExecutionStatus.kt @@ -10,7 +10,9 @@ enum class ExecutionStatus(val value: String) { @SerializedName("completed") COMPLETED("completed"), @SerializedName("failed") - FAILED("failed"); + FAILED("failed"), + @SerializedName("scheduled") + SCHEDULED("scheduled"); override fun toString() = value } \ No newline at end of file diff --git a/src/main/kotlin/io/appwrite/enums/Framework.kt b/src/main/kotlin/io/appwrite/enums/Framework.kt index 4087d6b..37c47e9 100644 --- a/src/main/kotlin/io/appwrite/enums/Framework.kt +++ b/src/main/kotlin/io/appwrite/enums/Framework.kt @@ -19,6 +19,8 @@ enum class Framework(val value: String) { SVELTEKIT("sveltekit"), @SerializedName("astro") ASTRO("astro"), + @SerializedName("tanstack-start") + TANSTACK_START("tanstack-start"), @SerializedName("remix") REMIX("remix"), @SerializedName("lynx") diff --git a/src/main/kotlin/io/appwrite/models/Execution.kt b/src/main/kotlin/io/appwrite/models/Execution.kt index 5b9863c..e77ee1f 100644 --- a/src/main/kotlin/io/appwrite/models/Execution.kt +++ b/src/main/kotlin/io/appwrite/models/Execution.kt @@ -52,7 +52,7 @@ data class Execution( val trigger: ExecutionTrigger, /** - * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, or `failed`. + * The status of the function execution. Possible values can be: `waiting`, `processing`, `completed`, `failed`, or `scheduled`. */ @SerializedName("status") val status: ExecutionStatus, diff --git a/src/main/kotlin/io/appwrite/services/Account.kt b/src/main/kotlin/io/appwrite/services/Account.kt index fd49679..b804a70 100644 --- a/src/main/kotlin/io/appwrite/services/Account.kt +++ b/src/main/kotlin/io/appwrite/services/Account.kt @@ -178,17 +178,20 @@ class Account(client: Client) : Service(client) { * Get the list of identities for the currently logged in user. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.IdentityList] */ @JvmOverloads @Throws(AppwriteException::class) suspend fun listIdentities( queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.IdentityList { val apiPath = "/account/identities" val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -264,17 +267,20 @@ class Account(client: Client) : Service(client) { * Get the list of latest security activity logs for the currently logged in user. Each log returns user IP address, location and date and time of log. * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @Throws(AppwriteException::class) suspend fun listLogs( queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/account/logs" val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Databases.kt b/src/main/kotlin/io/appwrite/services/Databases.kt index cba2637..097dec7 100644 --- a/src/main/kotlin/io/appwrite/services/Databases.kt +++ b/src/main/kotlin/io/appwrite/services/Databases.kt @@ -18,6 +18,7 @@ class Databases(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DatabaseList] */ @Deprecated( @@ -29,12 +30,14 @@ class Databases(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.DatabaseList { val apiPath = "/databases" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -400,6 +403,7 @@ class Databases(client: Client) : Service(client) { * @param databaseId Database ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, documentSecurity * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.CollectionList] */ @Deprecated( @@ -412,6 +416,7 @@ class Databases(client: Client) : Service(client) { databaseId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.CollectionList { val apiPath = "/databases/{databaseId}/collections" .replace("{databaseId}", databaseId) @@ -419,6 +424,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -614,6 +620,7 @@ class Databases(client: Client) : Service(client) { * @param databaseId Database ID. * @param collectionId Collection ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, size, required, array, status, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.AttributeList] */ @Deprecated( @@ -626,6 +633,7 @@ class Databases(client: Client) : Service(client) { databaseId: String, collectionId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.AttributeList { val apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes" .replace("{databaseId}", databaseId) @@ -633,6 +641,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2105,6 +2114,7 @@ class Databases(client: Client) : Service(client) { * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DocumentList] */ @Deprecated( @@ -2118,6 +2128,7 @@ class Databases(client: Client) : Service(client) { collectionId: String, queries: List? = null, transactionId: String? = null, + total: Boolean? = null, nestedType: Class, ): io.appwrite.models.DocumentList { val apiPath = "/databases/{databaseId}/collections/{collectionId}/documents" @@ -2127,6 +2138,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "transactionId" to transactionId, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2150,6 +2162,7 @@ class Databases(client: Client) : Service(client) { * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DocumentList] */ @Deprecated( @@ -2163,11 +2176,13 @@ class Databases(client: Client) : Service(client) { collectionId: String, queries: List? = null, transactionId: String? = null, + total: Boolean? = null, ): io.appwrite.models.DocumentList> = listDocuments( databaseId, collectionId, queries, transactionId, + total, nestedType = classOf(), ) @@ -3043,6 +3058,7 @@ class Databases(client: Client) : Service(client) { * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: key, type, status, attributes, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.IndexList] */ @Deprecated( @@ -3055,6 +3071,7 @@ class Databases(client: Client) : Service(client) { databaseId: String, collectionId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.IndexList { val apiPath = "/databases/{databaseId}/collections/{collectionId}/indexes" .replace("{databaseId}", databaseId) @@ -3062,6 +3079,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Functions.kt b/src/main/kotlin/io/appwrite/services/Functions.kt index a03752d..41480ec 100644 --- a/src/main/kotlin/io/appwrite/services/Functions.kt +++ b/src/main/kotlin/io/appwrite/services/Functions.kt @@ -20,6 +20,7 @@ class Functions(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, runtime, deploymentId, schedule, scheduleNext, schedulePrevious, timeout, entrypoint, commands, installationId * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.FunctionList] */ @JvmOverloads @@ -27,12 +28,14 @@ class Functions(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.FunctionList { val apiPath = "/functions" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -366,6 +369,7 @@ class Functions(client: Client) : Service(client) { * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DeploymentList] */ @JvmOverloads @@ -374,6 +378,7 @@ class Functions(client: Client) : Service(client) { functionId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.DeploymentList { val apiPath = "/functions/{functionId}/deployments" .replace("{functionId}", functionId) @@ -381,6 +386,7 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -714,6 +720,7 @@ class Functions(client: Client) : Service(client) { * * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ExecutionList] */ @JvmOverloads @@ -721,12 +728,14 @@ class Functions(client: Client) : Service(client) { suspend fun listExecutions( functionId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.ExecutionList { val apiPath = "/functions/{functionId}/executions" .replace("{functionId}", functionId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Messaging.kt b/src/main/kotlin/io/appwrite/services/Messaging.kt index 7da5fca..163dea0 100644 --- a/src/main/kotlin/io/appwrite/services/Messaging.kt +++ b/src/main/kotlin/io/appwrite/services/Messaging.kt @@ -18,6 +18,7 @@ class Messaging(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: scheduledAt, deliveredAt, deliveredTotal, status, description, providerType * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.MessageList] */ @JvmOverloads @@ -25,12 +26,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listMessages( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.MessageList { val apiPath = "/messaging/messages" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -624,6 +627,7 @@ class Messaging(client: Client) : Service(client) { * * @param messageId Message ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @@ -631,12 +635,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listMessageLogs( messageId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/messaging/messages/{messageId}/logs" .replace("{messageId}", messageId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -658,6 +664,7 @@ class Messaging(client: Client) : Service(client) { * * @param messageId Message ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TargetList] */ @JvmOverloads @@ -665,12 +672,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listTargets( messageId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.TargetList { val apiPath = "/messaging/messages/{messageId}/targets" .replace("{messageId}", messageId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -692,6 +701,7 @@ class Messaging(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ProviderList] */ @JvmOverloads @@ -699,12 +709,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listProviders( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.ProviderList { val apiPath = "/messaging/providers" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -1325,6 +1337,112 @@ class Messaging(client: Client) : Service(client) { ) } + /** + * Create a new Resend provider. + * + * @param providerId Provider ID. Choose a custom ID or generate a random ID with `ID.unique()`. 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 name Provider name. + * @param apiKey Resend API key. + * @param fromName Sender Name. + * @param fromEmail Sender email address. + * @param replyToName Name set in the reply to field for the mail. Default value is sender name. + * @param replyToEmail Email set in the reply to field for the mail. Default value is sender email. + * @param enabled Set as enabled. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun createResendProvider( + providerId: String, + name: String, + apiKey: String? = null, + fromName: String? = null, + fromEmail: String? = null, + replyToName: String? = null, + replyToEmail: String? = null, + enabled: Boolean? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/resend" + + val apiParams = mutableMapOf( + "providerId" to providerId, + "name" to name, + "apiKey" to apiKey, + "fromName" to fromName, + "fromEmail" to fromEmail, + "replyToName" to replyToName, + "replyToEmail" to replyToEmail, + "enabled" to enabled, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "POST", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + + /** + * Update a Resend provider by its unique ID. + * + * @param providerId Provider ID. + * @param name Provider name. + * @param enabled Set as enabled. + * @param apiKey Resend API key. + * @param fromName Sender Name. + * @param fromEmail Sender email address. + * @param replyToName Name set in the Reply To field for the mail. Default value is Sender Name. + * @param replyToEmail Email set in the Reply To field for the mail. Default value is Sender Email. + * @return [io.appwrite.models.Provider] + */ + @JvmOverloads + @Throws(AppwriteException::class) + suspend fun updateResendProvider( + providerId: String, + name: String? = null, + enabled: Boolean? = null, + apiKey: String? = null, + fromName: String? = null, + fromEmail: String? = null, + replyToName: String? = null, + replyToEmail: String? = null, + ): io.appwrite.models.Provider { + val apiPath = "/messaging/providers/resend/{providerId}" + .replace("{providerId}", providerId) + + val apiParams = mutableMapOf( + "name" to name, + "enabled" to enabled, + "apiKey" to apiKey, + "fromName" to fromName, + "fromEmail" to fromEmail, + "replyToName" to replyToName, + "replyToEmail" to replyToEmail, + ) + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + ) + val converter: (Any) -> io.appwrite.models.Provider = { + io.appwrite.models.Provider.from(map = it as Map) + } + return client.call( + "PATCH", + apiPath, + apiHeaders, + apiParams, + responseType = io.appwrite.models.Provider::class.java, + converter, + ) + } + /** * Create a new Sendgrid provider. * @@ -2162,6 +2280,7 @@ class Messaging(client: Client) : Service(client) { * * @param providerId Provider ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @@ -2169,12 +2288,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listProviderLogs( providerId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/messaging/providers/{providerId}/logs" .replace("{providerId}", providerId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2196,6 +2317,7 @@ class Messaging(client: Client) : Service(client) { * * @param subscriberId Subscriber ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @@ -2203,12 +2325,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listSubscriberLogs( subscriberId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/messaging/subscribers/{subscriberId}/logs" .replace("{subscriberId}", subscriberId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2230,6 +2354,7 @@ class Messaging(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, description, emailTotal, smsTotal, pushTotal * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TopicList] */ @JvmOverloads @@ -2237,12 +2362,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listTopics( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.TopicList { val apiPath = "/messaging/topics" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2399,6 +2526,7 @@ class Messaging(client: Client) : Service(client) { * * @param topicId Topic ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @@ -2406,12 +2534,14 @@ class Messaging(client: Client) : Service(client) { suspend fun listTopicLogs( topicId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/messaging/topics/{topicId}/logs" .replace("{topicId}", topicId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2434,6 +2564,7 @@ class Messaging(client: Client) : Service(client) { * @param topicId Topic ID. The topic ID subscribed to. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, provider, type, enabled * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.SubscriberList] */ @JvmOverloads @@ -2442,6 +2573,7 @@ class Messaging(client: Client) : Service(client) { topicId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.SubscriberList { val apiPath = "/messaging/topics/{topicId}/subscribers" .replace("{topicId}", topicId) @@ -2449,6 +2581,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Sites.kt b/src/main/kotlin/io/appwrite/services/Sites.kt index 9ce9aaf..5868584 100644 --- a/src/main/kotlin/io/appwrite/services/Sites.kt +++ b/src/main/kotlin/io/appwrite/services/Sites.kt @@ -20,6 +20,7 @@ class Sites(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, enabled, framework, deploymentId, buildCommand, installCommand, outputDirectory, installationId * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.SiteList] */ @JvmOverloads @@ -27,12 +28,14 @@ class Sites(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.SiteList { val apiPath = "/sites" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -366,6 +369,7 @@ class Sites(client: Client) : Service(client) { * @param siteId Site ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: buildSize, sourceSize, totalSize, buildDuration, status, activate, type * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DeploymentList] */ @JvmOverloads @@ -374,6 +378,7 @@ class Sites(client: Client) : Service(client) { siteId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.DeploymentList { val apiPath = "/sites/{siteId}/deployments" .replace("{siteId}", siteId) @@ -381,6 +386,7 @@ class Sites(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -709,6 +715,7 @@ class Sites(client: Client) : Service(client) { * * @param siteId Site ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: trigger, status, responseStatusCode, duration, requestMethod, requestPath, deploymentId + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ExecutionList] */ @JvmOverloads @@ -716,12 +723,14 @@ class Sites(client: Client) : Service(client) { suspend fun listLogs( siteId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.ExecutionList { val apiPath = "/sites/{siteId}/logs" .replace("{siteId}", siteId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Storage.kt b/src/main/kotlin/io/appwrite/services/Storage.kt index c1cad5e..3f899bd 100644 --- a/src/main/kotlin/io/appwrite/services/Storage.kt +++ b/src/main/kotlin/io/appwrite/services/Storage.kt @@ -20,6 +20,7 @@ class Storage(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: enabled, name, fileSecurity, maximumFileSize, encryption, antivirus * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.BucketList] */ @JvmOverloads @@ -27,12 +28,14 @@ class Storage(client: Client) : Service(client) { suspend fun listBuckets( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.BucketList { val apiPath = "/storage/buckets" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -230,6 +233,7 @@ class Storage(client: Client) : Service(client) { * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/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/queries). 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 total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.FileList] */ @JvmOverloads @@ -238,6 +242,7 @@ class Storage(client: Client) : Service(client) { bucketId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.FileList { val apiPath = "/storage/buckets/{bucketId}/files" .replace("{bucketId}", bucketId) @@ -245,6 +250,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/TablesDb.kt b/src/main/kotlin/io/appwrite/services/TablesDb.kt index 24e664a..3201348 100644 --- a/src/main/kotlin/io/appwrite/services/TablesDb.kt +++ b/src/main/kotlin/io/appwrite/services/TablesDb.kt @@ -18,6 +18,7 @@ class TablesDB(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.DatabaseList] */ @JvmOverloads @@ -25,12 +26,14 @@ class TablesDB(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.DatabaseList { val apiPath = "/tablesdb" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -380,6 +383,7 @@ class TablesDB(client: Client) : Service(client) { * @param databaseId Database ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: name, enabled, rowSecurity * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TableList] */ @JvmOverloads @@ -388,6 +392,7 @@ class TablesDB(client: Client) : Service(client) { databaseId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.TableList { val apiPath = "/tablesdb/{databaseId}/tables" .replace("{databaseId}", databaseId) @@ -395,6 +400,7 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -574,6 +580,7 @@ class TablesDB(client: Client) : Service(client) { * @param databaseId Database ID. * @param tableId Table ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, size, required, array, status, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ColumnList] */ @JvmOverloads @@ -582,6 +589,7 @@ class TablesDB(client: Client) : Service(client) { databaseId: String, tableId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.ColumnList { val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/columns" .replace("{databaseId}", databaseId) @@ -589,6 +597,7 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -1947,6 +1956,7 @@ class TablesDB(client: Client) : Service(client) { * @param databaseId Database ID. * @param tableId Table ID. You can create a new table using the Database service [server integration](https://appwrite.io/docs/references/cloud/server-dart/tablesDB#createTable). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following columns: key, type, status, attributes, error + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ColumnIndexList] */ @JvmOverloads @@ -1955,6 +1965,7 @@ class TablesDB(client: Client) : Service(client) { databaseId: String, tableId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.ColumnIndexList { val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/indexes" .replace("{databaseId}", databaseId) @@ -1962,6 +1973,7 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2105,6 +2117,7 @@ class TablesDB(client: Client) : Service(client) { * @param tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.RowList] */ @JvmOverloads @@ -2114,6 +2127,7 @@ class TablesDB(client: Client) : Service(client) { tableId: String, queries: List? = null, transactionId: String? = null, + total: Boolean? = null, nestedType: Class, ): io.appwrite.models.RowList { val apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows" @@ -2123,6 +2137,7 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "transactionId" to transactionId, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -2146,6 +2161,7 @@ class TablesDB(client: Client) : Service(client) { * @param tableId Table ID. You can create a new table using the TablesDB service [server integration](https://appwrite.io/docs/products/databases/tables#create-table). * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. * @param transactionId Transaction ID to read uncommitted changes within the transaction. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.RowList] */ @JvmOverloads @@ -2155,11 +2171,13 @@ class TablesDB(client: Client) : Service(client) { tableId: String, queries: List? = null, transactionId: String? = null, + total: Boolean? = null, ): io.appwrite.models.RowList> = listRows( databaseId, tableId, queries, transactionId, + total, nestedType = classOf(), ) diff --git a/src/main/kotlin/io/appwrite/services/Teams.kt b/src/main/kotlin/io/appwrite/services/Teams.kt index 923a01b..caeeea3 100644 --- a/src/main/kotlin/io/appwrite/services/Teams.kt +++ b/src/main/kotlin/io/appwrite/services/Teams.kt @@ -18,6 +18,7 @@ class Teams(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TeamList] */ @JvmOverloads @@ -25,6 +26,7 @@ class Teams(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, nestedType: Class, ): io.appwrite.models.TeamList { val apiPath = "/teams" @@ -32,6 +34,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -53,6 +56,7 @@ class Teams(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TeamList] */ @JvmOverloads @@ -60,9 +64,11 @@ class Teams(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.TeamList> = list( queries, search, + total, nestedType = classOf(), ) @@ -256,6 +262,7 @@ class Teams(client: Client) : Service(client) { * @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/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.MembershipList] */ @JvmOverloads @@ -264,6 +271,7 @@ class Teams(client: Client) : Service(client) { teamId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.MembershipList { val apiPath = "/teams/{teamId}/memberships" .replace("{teamId}", teamId) @@ -271,6 +279,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Tokens.kt b/src/main/kotlin/io/appwrite/services/Tokens.kt index 088b069..3354a86 100644 --- a/src/main/kotlin/io/appwrite/services/Tokens.kt +++ b/src/main/kotlin/io/appwrite/services/Tokens.kt @@ -19,6 +19,7 @@ class Tokens(client: Client) : Service(client) { * @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](https://appwrite.io/docs/server/storage#createBucket). * @param fileId File unique ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: expire + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.ResourceTokenList] */ @JvmOverloads @@ -27,6 +28,7 @@ class Tokens(client: Client) : Service(client) { bucketId: String, fileId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.ResourceTokenList { val apiPath = "/tokens/buckets/{bucketId}/files/{fileId}" .replace("{bucketId}", bucketId) @@ -34,6 +36,7 @@ class Tokens(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) diff --git a/src/main/kotlin/io/appwrite/services/Users.kt b/src/main/kotlin/io/appwrite/services/Users.kt index 26337e9..748a0ad 100644 --- a/src/main/kotlin/io/appwrite/services/Users.kt +++ b/src/main/kotlin/io/appwrite/services/Users.kt @@ -18,6 +18,7 @@ class Users(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.UserList] */ @JvmOverloads @@ -25,6 +26,7 @@ class Users(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, nestedType: Class, ): io.appwrite.models.UserList { val apiPath = "/users" @@ -32,6 +34,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -53,6 +56,7 @@ class Users(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, email, phone, status, passwordUpdate, registration, emailVerification, phoneVerification, labels * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.UserList] */ @JvmOverloads @@ -60,9 +64,11 @@ class Users(client: Client) : Service(client) { suspend fun list( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.UserList> = list( queries, search, + total, nestedType = classOf(), ) @@ -275,6 +281,7 @@ class Users(client: Client) : Service(client) { * * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, provider, providerUid, providerEmail, providerAccessTokenExpiry * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.IdentityList] */ @JvmOverloads @@ -282,12 +289,14 @@ class Users(client: Client) : Service(client) { suspend fun listIdentities( queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.IdentityList { val apiPath = "/users/identities" val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -938,6 +947,7 @@ class Users(client: Client) : Service(client) { * * @param userId User ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Only supported methods are limit and offset + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.LogList] */ @JvmOverloads @@ -945,12 +955,14 @@ class Users(client: Client) : Service(client) { suspend fun listLogs( userId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.LogList { val apiPath = "/users/{userId}/logs" .replace("{userId}", userId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -973,6 +985,7 @@ class Users(client: Client) : Service(client) { * @param userId User ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles * @param search Search term to filter your list results. Max length: 256 chars. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.MembershipList] */ @JvmOverloads @@ -981,6 +994,7 @@ class Users(client: Client) : Service(client) { userId: String, queries: List? = null, search: String? = null, + total: Boolean? = null, ): io.appwrite.models.MembershipList { val apiPath = "/users/{userId}/memberships" .replace("{userId}", userId) @@ -988,6 +1002,7 @@ class Users(client: Client) : Service(client) { val apiParams = mutableMapOf( "queries" to queries, "search" to search, + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -1697,16 +1712,20 @@ class Users(client: Client) : Service(client) { * Get the user sessions list by its unique ID. * * @param userId User ID. + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.SessionList] */ + @JvmOverloads @Throws(AppwriteException::class) suspend fun listSessions( userId: String, + total: Boolean? = null, ): io.appwrite.models.SessionList { val apiPath = "/users/{userId}/sessions" .replace("{userId}", userId) val apiParams = mutableMapOf( + "total" to total, ) val apiHeaders = mutableMapOf( ) @@ -1870,6 +1889,7 @@ class Users(client: Client) : Service(client) { * * @param userId User ID. * @param queries Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, providerId, identifier, providerType + * @param total When set to false, the total count returned will be 0 and will not be calculated. * @return [io.appwrite.models.TargetList] */ @JvmOverloads @@ -1877,12 +1897,14 @@ class Users(client: Client) : Service(client) { suspend fun listTargets( userId: String, queries: List? = null, + total: Boolean? = null, ): io.appwrite.models.TargetList { val apiPath = "/users/{userId}/targets" .replace("{userId}", userId) val apiParams = mutableMapOf( "queries" to queries, + "total" to total, ) val apiHeaders = mutableMapOf( ) From bbfd3c454095549c4a835903f0205adc845dc323 Mon Sep 17 00:00:00 2001 From: Jake Barnby Date: Mon, 3 Nov 2025 17:40:17 +1300 Subject: [PATCH 2/2] Update changelogs --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index dd56fb6..362c9aa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -4,6 +4,7 @@ * Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance * Add `Operator` class for atomic modification of rows via update, bulk update, upsert, and bulk upsert operations +* Add `createResendProvider` and `updateResendProvider` methods to `Messaging` service ## 12.2.1