Skip to content

Commit 5e20467

Browse files
authored
Merge pull request #62 from appwrite/dev
feat: Kotlin SDK update for version 13.0.0
2 parents 8e9f560 + abbe4d3 commit 5e20467

File tree

176 files changed

+1420
-273
lines changed

Some content is hidden

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

176 files changed

+1420
-273
lines changed

CHANGELOG.md

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
# Change Log
22

3+
## 13.0.0
4+
5+
* Rename `VCSDeploymentType` enum to `VCSReferenceType`
6+
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
7+
* Add `getScreenshot` method to `Avatars` service
8+
* Add `Theme`, `Timezone` and `Output` enums
9+
310
## 12.3.0
411

512
* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ repositories {
3939
Next, add the dependency to your project's `build.gradle(.kts)` file:
4040

4141
```groovy
42-
implementation("io.appwrite:sdk-for-kotlin:12.3.0")
42+
implementation("io.appwrite:sdk-for-kotlin:13.0.0")
4343
```
4444

4545
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
5050
<dependency>
5151
<groupId>io.appwrite</groupId>
5252
<artifactId>sdk-for-kotlin</artifactId>
53-
<version>12.3.0</version>
53+
<version>13.0.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/account/create-o-auth-2-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ account.createOAuth2Token(
1313
OAuthProvider.AMAZON, // provider
1414
"https://example.com", // success (optional)
1515
"https://example.com", // failure (optional)
16-
listOf(), // scopes (optional)
16+
List.of(), // scopes (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {
1919
error.printStackTrace();

docs/examples/java/account/list-identities.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010
Account account = new Account(client);
1111

1212
account.listIdentities(
13-
listOf(), // queries (optional)
13+
List.of(), // queries (optional)
1414
false, // total (optional)
1515
new CoroutineCallback<>((result, error) -> {
1616
if (error != null) {

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ Client client = new Client()
1010
Account account = new Account(client);
1111

1212
account.listLogs(
13-
listOf(), // queries (optional)
13+
List.of(), // queries (optional)
1414
false, // total (optional)
1515
new CoroutineCallback<>((result, error) -> {
1616
if (error != null) {

docs/examples/java/account/update-prefs.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ Client client = new Client()
1010
Account account = new Account(client);
1111

1212
account.updatePrefs(
13-
mapOf(
14-
"language" to "en",
15-
"timezone" to "UTC",
16-
"darkTheme" to true
13+
Map.of(
14+
"language", "en",
15+
"timezone", "UTC",
16+
"darkTheme", true
1717
), // prefs
1818
new CoroutineCallback<>((result, error) -> {
1919
if (error != null) {
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import io.appwrite.Client;
2+
import io.appwrite.coroutines.CoroutineCallback;
3+
import io.appwrite.services.Avatars;
4+
import io.appwrite.enums.Theme;
5+
import io.appwrite.enums.Timezone;
6+
import io.appwrite.enums.Output;
7+
8+
Client client = new Client()
9+
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
10+
.setProject("<YOUR_PROJECT_ID>") // Your project ID
11+
.setSession(""); // The user session to authenticate with
12+
13+
Avatars avatars = new Avatars(client);
14+
15+
avatars.getScreenshot(
16+
"https://example.com", // url
17+
Map.of(
18+
"Authorization", "Bearer token123",
19+
"X-Custom-Header", "value"
20+
), // headers (optional)
21+
1920, // viewportWidth (optional)
22+
1080, // viewportHeight (optional)
23+
2, // scale (optional)
24+
Theme.LIGHT, // theme (optional)
25+
"Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional)
26+
true, // fullpage (optional)
27+
"en-US", // locale (optional)
28+
Timezone.AFRICA_ABIDJAN, // timezone (optional)
29+
37.7749, // latitude (optional)
30+
-122.4194, // longitude (optional)
31+
100, // accuracy (optional)
32+
true, // touch (optional)
33+
List.of("geolocation", "notifications"), // permissions (optional)
34+
3, // sleep (optional)
35+
800, // width (optional)
36+
600, // height (optional)
37+
85, // quality (optional)
38+
Output.JPG, // output (optional)
39+
new CoroutineCallback<>((result, error) -> {
40+
if (error != null) {
41+
error.printStackTrace();
42+
return;
43+
}
44+
45+
System.out.println(result);
46+
})
47+
);
48+

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import io.appwrite.Client;
22
import io.appwrite.coroutines.CoroutineCallback;
3-
import io.appwrite.services.Databases;
43
import io.appwrite.Permission;
54
import io.appwrite.Role;
5+
import io.appwrite.services.Databases;
66

77
Client client = new Client()
88
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@@ -15,7 +15,7 @@ databases.createCollection(
1515
"<DATABASE_ID>", // databaseId
1616
"<COLLECTION_ID>", // collectionId
1717
"<NAME>", // name
18-
listOf(Permission.read(Role.any())), // permissions (optional)
18+
List.of(Permission.read(Role.any())), // permissions (optional)
1919
false, // documentSecurity (optional)
2020
false, // enabled (optional)
2121
new CoroutineCallback<>((result, error) -> {

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

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import io.appwrite.Client;
22
import io.appwrite.coroutines.CoroutineCallback;
3-
import io.appwrite.services.Databases;
43
import io.appwrite.Permission;
54
import io.appwrite.Role;
5+
import io.appwrite.services.Databases;
66

77
Client client = new Client()
88
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
@@ -15,14 +15,14 @@ databases.createDocument(
1515
"<DATABASE_ID>", // databaseId
1616
"<COLLECTION_ID>", // collectionId
1717
"<DOCUMENT_ID>", // documentId
18-
mapOf(
19-
"username" to "walter.obrien",
20-
"email" to "walter.obrien@example.com",
21-
"fullName" to "Walter O'Brien",
22-
"age" to 30,
23-
"isAdmin" to false
18+
Map.of(
19+
"username", "walter.obrien",
20+
"email", "walter.obrien@example.com",
21+
"fullName", "Walter O'Brien",
22+
"age", 30,
23+
"isAdmin", false
2424
), // data
25-
listOf(Permission.read(Role.any())), // permissions (optional)
25+
List.of(Permission.read(Role.any())), // permissions (optional)
2626
"<TRANSACTION_ID>", // transactionId (optional)
2727
new CoroutineCallback<>((result, error) -> {
2828
if (error != null) {

docs/examples/java/databases/create-documents.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Databases databases = new Databases(client);
1212
databases.createDocuments(
1313
"<DATABASE_ID>", // databaseId
1414
"<COLLECTION_ID>", // collectionId
15-
listOf(), // documents
15+
List.of(), // documents
1616
"<TRANSACTION_ID>", // transactionId (optional)
1717
new CoroutineCallback<>((result, error) -> {
1818
if (error != null) {

0 commit comments

Comments
 (0)