mirror of
https://github.com/appwrite/sdk-for-kotlin.git
synced 2026-04-07 19:17:44 +00:00
Add operators
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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:
|
||||
<dependency>
|
||||
<groupId>io.appwrite</groupId>
|
||||
<artifactId>sdk-for-kotlin</artifactId>
|
||||
<version>12.2.1</version>
|
||||
<version>12.3.0</version>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
```
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ databases.createCollection(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // documentSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
|
||||
@@ -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://<REGION>.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)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ databases.listAttributes(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ databases.listCollections(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -14,6 +14,7 @@ databases.listDocuments(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // queries (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ databases.listIndexes(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Databases databases = new Databases(client);
|
||||
databases.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ databases.updateCollection(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // documentSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,7 +16,7 @@ databases.updateDocument(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<DOCUMENT_ID>", // documentId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,7 +16,7 @@ databases.upsertDocument(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<DOCUMENT_ID>", // documentId
|
||||
mapOf( "a" to "b" ), // data
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ functions.listDeployments(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Functions functions = new Functions(client);
|
||||
functions.listExecutions(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Functions functions = new Functions(client);
|
||||
functions.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Messaging;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Messaging messaging = new Messaging(client);
|
||||
|
||||
messaging.createResendProvider(
|
||||
"<PROVIDER_ID>", // providerId
|
||||
"<NAME>", // name
|
||||
"<API_KEY>", // apiKey (optional)
|
||||
"<FROM_NAME>", // fromName (optional)
|
||||
"email@example.com", // fromEmail (optional)
|
||||
"<REPLY_TO_NAME>", // replyToName (optional)
|
||||
"email@example.com", // replyToEmail (optional)
|
||||
false, // enabled (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listMessageLogs(
|
||||
"<MESSAGE_ID>", // messageId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listMessages(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listProviderLogs(
|
||||
"<PROVIDER_ID>", // providerId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listProviders(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listSubscriberLogs(
|
||||
"<SUBSCRIBER_ID>", // subscriberId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ messaging.listSubscribers(
|
||||
"<TOPIC_ID>", // topicId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listTargets(
|
||||
"<MESSAGE_ID>", // messageId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listTopicLogs(
|
||||
"<TOPIC_ID>", // topicId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Messaging messaging = new Messaging(client);
|
||||
messaging.listTopics(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -0,0 +1,30 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Messaging;
|
||||
|
||||
Client client = new Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>"); // Your secret API key
|
||||
|
||||
Messaging messaging = new Messaging(client);
|
||||
|
||||
messaging.updateResendProvider(
|
||||
"<PROVIDER_ID>", // providerId
|
||||
"<NAME>", // name (optional)
|
||||
false, // enabled (optional)
|
||||
"<API_KEY>", // apiKey (optional)
|
||||
"<FROM_NAME>", // fromName (optional)
|
||||
"email@example.com", // fromEmail (optional)
|
||||
"<REPLY_TO_NAME>", // replyToName (optional)
|
||||
"<REPLY_TO_EMAIL>", // replyToEmail (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
System.out.println(result);
|
||||
})
|
||||
);
|
||||
|
||||
@@ -13,6 +13,7 @@ sites.listDeployments(
|
||||
"<SITE_ID>", // siteId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Sites sites = new Sites(client);
|
||||
sites.listLogs(
|
||||
"<SITE_ID>", // siteId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Sites sites = new Sites(client);
|
||||
sites.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,7 +14,7 @@ Storage storage = new Storage(client);
|
||||
storage.createBucket(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // fileSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
1, // maximumFileSize (optional)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,7 +16,7 @@ storage.createFile(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<FILE_ID>", // 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();
|
||||
|
||||
@@ -12,6 +12,7 @@ Storage storage = new Storage(client);
|
||||
storage.listBuckets(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ storage.listFiles(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,7 +14,7 @@ Storage storage = new Storage(client);
|
||||
storage.updateBucket(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // fileSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
1, // maximumFileSize (optional)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ storage.updateFile(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<FILE_ID>", // fileId
|
||||
"<NAME>", // name (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -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://<REGION>.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)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ tablesDB.createTable(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<TABLE_ID>", // tableId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // rowSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
|
||||
@@ -13,6 +13,7 @@ tablesDB.listColumns(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<TABLE_ID>", // tableId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ tablesDB.listIndexes(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<TABLE_ID>", // tableId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -14,6 +14,7 @@ tablesDB.listRows(
|
||||
"<TABLE_ID>", // tableId
|
||||
listOf(), // queries (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ tablesDB.listTables(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ TablesDB tablesDB = new TablesDB(client);
|
||||
tablesDB.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,7 +16,7 @@ tablesDB.updateRow(
|
||||
"<TABLE_ID>", // tableId
|
||||
"<ROW_ID>", // rowId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ tablesDB.updateTable(
|
||||
"<DATABASE_ID>", // databaseId
|
||||
"<TABLE_ID>", // tableId
|
||||
"<NAME>", // name
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
false, // rowSecurity (optional)
|
||||
false, // enabled (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,7 +16,7 @@ tablesDB.upsertRow(
|
||||
"<TABLE_ID>", // tableId
|
||||
"<ROW_ID>", // rowId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ teams.listMemberships(
|
||||
"<TEAM_ID>", // teamId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Teams teams = new Teams(client);
|
||||
teams.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ tokens.list(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<FILE_ID>", // fileId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Users users = new Users(client);
|
||||
users.listIdentities(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Users users = new Users(client);
|
||||
users.listLogs(
|
||||
"<USER_ID>", // userId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -13,6 +13,7 @@ users.listMemberships(
|
||||
"<USER_ID>", // userId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -11,6 +11,7 @@ Users users = new Users(client);
|
||||
|
||||
users.listSessions(
|
||||
"<USER_ID>", // userId
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Users users = new Users(client);
|
||||
users.listTargets(
|
||||
"<USER_ID>", // userId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ Users users = new Users(client);
|
||||
users.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -10,5 +10,6 @@ val client = Client()
|
||||
val account = Account(client)
|
||||
|
||||
val response = account.listIdentities(
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -10,5 +10,6 @@ val client = Client()
|
||||
val account = Account(client)
|
||||
|
||||
val response = account.listLogs(
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ val response = databases.createCollection(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
documentSecurity = false, // optional
|
||||
enabled = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.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 = "<TRANSACTION_ID>" // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val databases = Databases(client)
|
||||
val response = databases.listAttributes(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val databases = Databases(client)
|
||||
val response = databases.listCollections(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -13,5 +13,6 @@ val response = databases.listDocuments(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
queries = listOf(), // optional
|
||||
transactionId = "<TRANSACTION_ID>" // optional
|
||||
transactionId = "<TRANSACTION_ID>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val databases = Databases(client)
|
||||
val response = databases.listIndexes(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val databases = Databases(client)
|
||||
|
||||
val response = databases.list(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ val response = databases.updateCollection(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
documentSecurity = false, // optional
|
||||
enabled = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,6 +16,6 @@ val response = databases.updateDocument(
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documentId = "<DOCUMENT_ID>",
|
||||
data = mapOf( "a" to "b" ), // optional
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
transactionId = "<TRANSACTION_ID>" // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,6 +16,6 @@ val response = databases.upsertDocument(
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documentId = "<DOCUMENT_ID>",
|
||||
data = mapOf( "a" to "b" ),
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
transactionId = "<TRANSACTION_ID>" // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val functions = Functions(client)
|
||||
val response = functions.listDeployments(
|
||||
functionId = "<FUNCTION_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val functions = Functions(client)
|
||||
|
||||
val response = functions.listExecutions(
|
||||
functionId = "<FUNCTION_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val functions = Functions(client)
|
||||
|
||||
val response = functions.list(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Messaging
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.createResendProvider(
|
||||
providerId = "<PROVIDER_ID>",
|
||||
name = "<NAME>",
|
||||
apiKey = "<API_KEY>", // optional
|
||||
fromName = "<FROM_NAME>", // optional
|
||||
fromEmail = "email@example.com", // optional
|
||||
replyToName = "<REPLY_TO_NAME>", // optional
|
||||
replyToEmail = "email@example.com", // optional
|
||||
enabled = false // optional
|
||||
)
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listMessageLogs(
|
||||
messageId = "<MESSAGE_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listMessages(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listProviderLogs(
|
||||
providerId = "<PROVIDER_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listProviders(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listSubscriberLogs(
|
||||
subscriberId = "<SUBSCRIBER_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val messaging = Messaging(client)
|
||||
val response = messaging.listSubscribers(
|
||||
topicId = "<TOPIC_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listTargets(
|
||||
messageId = "<MESSAGE_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listTopicLogs(
|
||||
topicId = "<TOPIC_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.listTopics(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Messaging
|
||||
|
||||
val client = Client()
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
.setProject("<YOUR_PROJECT_ID>") // Your project ID
|
||||
.setKey("<YOUR_API_KEY>") // Your secret API key
|
||||
|
||||
val messaging = Messaging(client)
|
||||
|
||||
val response = messaging.updateResendProvider(
|
||||
providerId = "<PROVIDER_ID>",
|
||||
name = "<NAME>", // optional
|
||||
enabled = false, // optional
|
||||
apiKey = "<API_KEY>", // optional
|
||||
fromName = "<FROM_NAME>", // optional
|
||||
fromEmail = "email@example.com", // optional
|
||||
replyToName = "<REPLY_TO_NAME>", // optional
|
||||
replyToEmail = "<REPLY_TO_EMAIL>" // optional
|
||||
)
|
||||
@@ -12,5 +12,6 @@ val sites = Sites(client)
|
||||
val response = sites.listDeployments(
|
||||
siteId = "<SITE_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val sites = Sites(client)
|
||||
|
||||
val response = sites.listLogs(
|
||||
siteId = "<SITE_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val sites = Sites(client)
|
||||
|
||||
val response = sites.list(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,7 +14,7 @@ val storage = Storage(client)
|
||||
val response = storage.createBucket(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
fileSecurity = false, // optional
|
||||
enabled = false, // optional
|
||||
maximumFileSize = 1, // optional
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,5 +16,5 @@ val response = storage.createFile(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
fileId = "<FILE_ID>",
|
||||
file = InputFile.fromPath("file.png"),
|
||||
permissions = listOf("read("any")") // optional
|
||||
permissions = listOf(Permission.read(Role.any())) // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val storage = Storage(client)
|
||||
|
||||
val response = storage.listBuckets(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val storage = Storage(client)
|
||||
val response = storage.listFiles(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,7 +14,7 @@ val storage = Storage(client)
|
||||
val response = storage.updateBucket(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
fileSecurity = false, // optional
|
||||
enabled = false, // optional
|
||||
maximumFileSize = 1, // optional
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,5 +15,5 @@ val response = storage.updateFile(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
fileId = "<FILE_ID>",
|
||||
name = "<NAME>", // optional
|
||||
permissions = listOf("read("any")") // optional
|
||||
permissions = listOf(Permission.read(Role.any())) // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.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 = "<TRANSACTION_ID>" // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ val response = tablesDB.createTable(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
tableId = "<TABLE_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
rowSecurity = false, // optional
|
||||
enabled = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val tablesDB = TablesDB(client)
|
||||
val response = tablesDB.listColumns(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
tableId = "<TABLE_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val tablesDB = TablesDB(client)
|
||||
val response = tablesDB.listIndexes(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
tableId = "<TABLE_ID>",
|
||||
queries = listOf() // optional
|
||||
queries = listOf(), // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -13,5 +13,6 @@ val response = tablesDB.listRows(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
tableId = "<TABLE_ID>",
|
||||
queries = listOf(), // optional
|
||||
transactionId = "<TRANSACTION_ID>" // optional
|
||||
transactionId = "<TRANSACTION_ID>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ val tablesDB = TablesDB(client)
|
||||
val response = tablesDB.listTables(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ val tablesDB = TablesDB(client)
|
||||
|
||||
val response = tablesDB.list(
|
||||
queries = listOf(), // optional
|
||||
search = "<SEARCH>" // optional
|
||||
search = "<SEARCH>", // optional
|
||||
total = false // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -14,6 +16,6 @@ val response = tablesDB.updateRow(
|
||||
tableId = "<TABLE_ID>",
|
||||
rowId = "<ROW_ID>",
|
||||
data = mapOf( "a" to "b" ), // optional
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
transactionId = "<TRANSACTION_ID>" // optional
|
||||
)
|
||||
|
||||
@@ -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://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ val response = tablesDB.updateTable(
|
||||
databaseId = "<DATABASE_ID>",
|
||||
tableId = "<TABLE_ID>",
|
||||
name = "<NAME>",
|
||||
permissions = listOf("read("any")"), // optional
|
||||
permissions = listOf(Permission.read(Role.any())), // optional
|
||||
rowSecurity = false, // optional
|
||||
enabled = false // optional
|
||||
)
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user