File tree Expand file tree Collapse file tree 11 files changed +414
-4
lines changed
src/main/kotlin/io/appwrite Expand file tree Collapse file tree 11 files changed +414
-4
lines changed Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ repositories {
39
39
Next, add the dependency to your project's ` build.gradle(.kts) ` file:
40
40
41
41
``` groovy
42
- implementation("io.appwrite:sdk-for-kotlin:8.0.0 ")
42
+ implementation("io.appwrite:sdk-for-kotlin:8.1.0-rc.1 ")
43
43
```
44
44
45
45
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
50
50
<dependency >
51
51
<groupId >io.appwrite</groupId >
52
52
<artifactId >sdk-for-kotlin</artifactId >
53
- <version >8.0.0 </version >
53
+ <version >8.1.0-rc.1 </version >
54
54
</dependency >
55
55
</dependencies >
56
56
```
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Databases;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setSession(""); // The user session to authenticate with
9
+
10
+ Databases databases = new Databases(client);
11
+
12
+ databases.createDocuments(
13
+ "<DATABASE_ID>", // databaseId
14
+ "<COLLECTION_ID>", // collectionId
15
+ listOf(), // documents
16
+ new CoroutineCallback<>((result, error) -> {
17
+ if (error != null) {
18
+ error.printStackTrace();
19
+ return;
20
+ }
21
+
22
+ System.out.println(result);
23
+ })
24
+ );
25
+
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Databases;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>"); // Your secret API key
9
+
10
+ Databases databases = new Databases(client);
11
+
12
+ databases.deleteDocuments(
13
+ "<DATABASE_ID>", // databaseId
14
+ "<COLLECTION_ID>", // collectionId
15
+ listOf(), // queries (optional)
16
+ new CoroutineCallback<>((result, error) -> {
17
+ if (error != null) {
18
+ error.printStackTrace();
19
+ return;
20
+ }
21
+
22
+ System.out.println(result);
23
+ })
24
+ );
25
+
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Databases;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>"); // Your secret API key
9
+
10
+ Databases databases = new Databases(client);
11
+
12
+ databases.updateDocuments(
13
+ "<DATABASE_ID>", // databaseId
14
+ "<COLLECTION_ID>", // collectionId
15
+ mapOf( "a" to "b" ), // data (optional)
16
+ listOf(), // queries (optional)
17
+ new CoroutineCallback<>((result, error) -> {
18
+ if (error != null) {
19
+ error.printStackTrace();
20
+ return;
21
+ }
22
+
23
+ System.out.println(result);
24
+ })
25
+ );
26
+
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Databases;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>"); // Your secret API key
9
+
10
+ Databases databases = new Databases(client);
11
+
12
+ databases.upsertDocuments(
13
+ "<DATABASE_ID>", // databaseId
14
+ "<COLLECTION_ID>", // collectionId
15
+ listOf(), // documents (optional)
16
+ new CoroutineCallback<>((result, error) -> {
17
+ if (error != null) {
18
+ error.printStackTrace();
19
+ return;
20
+ }
21
+
22
+ System.out.println(result);
23
+ })
24
+ );
25
+
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Databases
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setSession("") // The user session to authenticate with
9
+
10
+ val databases = Databases(client)
11
+
12
+ val response = databases.createDocuments(
13
+ databaseId = "<DATABASE_ID>",
14
+ collectionId = "<COLLECTION_ID>",
15
+ documents = listOf()
16
+ )
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Databases
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>") // Your secret API key
9
+
10
+ val databases = Databases(client)
11
+
12
+ val response = databases.deleteDocuments(
13
+ databaseId = "<DATABASE_ID>",
14
+ collectionId = "<COLLECTION_ID>",
15
+ queries = listOf() // optional
16
+ )
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Databases
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>") // Your secret API key
9
+
10
+ val databases = Databases(client)
11
+
12
+ val response = databases.updateDocuments(
13
+ databaseId = "<DATABASE_ID>",
14
+ collectionId = "<COLLECTION_ID>",
15
+ data = mapOf( "a" to "b" ), // optional
16
+ queries = listOf() // optional
17
+ )
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Databases
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://<REGION >.cloud.appwrite.io/v1") // Your API Endpoint
7
+ .setProject("<YOUR_PROJECT_ID>") // Your project ID
8
+ .setKey("<YOUR_API_KEY>") // Your secret API key
9
+
10
+ val databases = Databases(client)
11
+
12
+ val response = databases.upsertDocuments(
13
+ databaseId = "<DATABASE_ID>",
14
+ collectionId = "<COLLECTION_ID>",
15
+ documents = listOf() // optional
16
+ )
Original file line number Diff line number Diff line change @@ -58,11 +58,11 @@ class Client @JvmOverloads constructor(
58
58
init {
59
59
headers = mutableMapOf (
60
60
" content-type" to " application/json" ,
61
- " user-agent" to " AppwriteKotlinSDK/8.0.0 ${System .getProperty(" http.agent" )} " ,
61
+ " user-agent" to " AppwriteKotlinSDK/8.1.0-rc.1 ${System .getProperty(" http.agent" )} " ,
62
62
" x-sdk-name" to " Kotlin" ,
63
63
" x-sdk-platform" to " server" ,
64
64
" x-sdk-language" to " kotlin" ,
65
- " x-sdk-version" to " 8.0.0 " ,
65
+ " x-sdk-version" to " 8.1.0-rc.1 " ,
66
66
" x-appwrite-response-format" to " 1.6.0" ,
67
67
)
68
68
You can’t perform that action at this time.
0 commit comments