Skip to content

Commit f9b6a77

Browse files
committed
feat: update kotlin sdk to 0.12.x
1 parent 7171c29 commit f9b6a77

File tree

89 files changed

+2081
-395
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

89 files changed

+2081
-395
lines changed

.github/ISSUE_TEMPLATE/bug.yaml

Lines changed: 0 additions & 82 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/documentation.yaml

Lines changed: 0 additions & 32 deletions
This file was deleted.

.github/ISSUE_TEMPLATE/feature.yaml

Lines changed: 0 additions & 40 deletions
This file was deleted.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square)
44
![License](https://img.shields.io/github/license/appwrite/sdk-for-kotlin.svg?style=flat-square)
5-
![Version](https://img.shields.io/badge/api%20version-0.11.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.12.0-blue.svg?style=flat-square)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite_io?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite_io)
77
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)
88

9-
**This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).**
9+
**This SDK is compatible with Appwrite server version 0.12.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-kotlin/releases).**
1010

1111
> This is the Kotlin SDK for integrating with Appwrite from your Kotlin server-side code. If you're looking for the Android SDK you should check [appwrite/sdk-for-android](https://github.com/appwrite/sdk-for-android)
1212

docs/examples/java/account/get-logs.md

Lines changed: 20 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,26 +8,28 @@ public void main() {
88
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
99

1010
Account account = new Account(client);
11-
account.getLogs(new Continuation<Response>() {
12-
@NotNull
13-
@Override
14-
public CoroutineContext getContext() {
15-
return EmptyCoroutineContext.INSTANCE;
16-
}
11+
account.getLogs(
12+
new Continuation<Response>() {
13+
@NotNull
14+
@Override
15+
public CoroutineContext getContext() {
16+
return EmptyCoroutineContext.INSTANCE;
17+
}
1718

18-
@Override
19-
public void resumeWith(@NotNull Object o) {
20-
String json = "";
21-
try {
22-
if (o instanceof Result.Failure) {
23-
Result.Failure failure = (Result.Failure) o;
24-
throw failure.exception;
25-
} else {
26-
Response response = (Response) o;
19+
@Override
20+
public void resumeWith(@NotNull Object o) {
21+
String json = "";
22+
try {
23+
if (o instanceof Result.Failure) {
24+
Result.Failure failure = (Result.Failure) o;
25+
throw failure.exception;
26+
} else {
27+
Response response = (Response) o;
28+
}
29+
} catch (Throwable th) {
30+
Log.e("ERROR", th.toString());
2731
}
28-
} catch (Throwable th) {
29-
Log.e("ERROR", th.toString());
3032
}
3133
}
32-
});
34+
);
3335
}
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Database
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Database database = new Database(client);
11+
database.createBooleanAttribute(
12+
collectionId = "[COLLECTION_ID]",
13+
attributeId = "",
14+
required = false,
15+
new Continuation<Response>() {
16+
@NotNull
17+
@Override
18+
public CoroutineContext getContext() {
19+
return EmptyCoroutineContext.INSTANCE;
20+
}
21+
22+
@Override
23+
public void resumeWith(@NotNull Object o) {
24+
String json = "";
25+
try {
26+
if (o instanceof Result.Failure) {
27+
Result.Failure failure = (Result.Failure) o;
28+
throw failure.exception;
29+
} else {
30+
Response response = (Response) o;
31+
}
32+
} catch (Throwable th) {
33+
Log.e("ERROR", th.toString());
34+
}
35+
}
36+
}
37+
);
38+
}

docs/examples/java/database/create-collection.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,10 +9,11 @@ public void main() {
99

1010
Database database = new Database(client);
1111
database.createCollection(
12+
collectionId = "",
1213
name = "[NAME]",
13-
read = listOf(),
14-
write = listOf(),
15-
rules = listOf()
14+
permission = "document",
15+
read = ["role:all"],
16+
write = ["role:all"]
1617
new Continuation<Response>() {
1718
@NotNull
1819
@Override

docs/examples/java/database/create-document.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ public void main() {
1010
Database database = new Database(client);
1111
database.createDocument(
1212
collectionId = "[COLLECTION_ID]",
13+
documentId = "",
1314
data = mapOf( "a" to "b" ),
1415
new Continuation<Response>() {
1516
@NotNull
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Database
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Database database = new Database(client);
11+
database.createEmailAttribute(
12+
collectionId = "[COLLECTION_ID]",
13+
attributeId = "",
14+
required = false,
15+
new Continuation<Response>() {
16+
@NotNull
17+
@Override
18+
public CoroutineContext getContext() {
19+
return EmptyCoroutineContext.INSTANCE;
20+
}
21+
22+
@Override
23+
public void resumeWith(@NotNull Object o) {
24+
String json = "";
25+
try {
26+
if (o instanceof Result.Failure) {
27+
Result.Failure failure = (Result.Failure) o;
28+
throw failure.exception;
29+
} else {
30+
Response response = (Response) o;
31+
}
32+
} catch (Throwable th) {
33+
Log.e("ERROR", th.toString());
34+
}
35+
}
36+
}
37+
);
38+
}
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Database
3+
4+
public void main() {
5+
Client client = Client(context)
6+
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
7+
.setProject("5df5acd0d48c2") // Your project ID
8+
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
9+
10+
Database database = new Database(client);
11+
database.createEnumAttribute(
12+
collectionId = "[COLLECTION_ID]",
13+
attributeId = "",
14+
elements = listOf(),
15+
required = false,
16+
new Continuation<Response>() {
17+
@NotNull
18+
@Override
19+
public CoroutineContext getContext() {
20+
return EmptyCoroutineContext.INSTANCE;
21+
}
22+
23+
@Override
24+
public void resumeWith(@NotNull Object o) {
25+
String json = "";
26+
try {
27+
if (o instanceof Result.Failure) {
28+
Result.Failure failure = (Result.Failure) o;
29+
throw failure.exception;
30+
} else {
31+
Response response = (Response) o;
32+
}
33+
} catch (Throwable th) {
34+
Log.e("ERROR", th.toString());
35+
}
36+
}
37+
}
38+
);
39+
}

0 commit comments

Comments
 (0)