Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Change Log

## 13.0.0

* Rename `VCSDeploymentType` enum to `VCSReferenceType`
* Change `createTemplateDeployment` method signature: replace `version` parameter with `type` (TemplateReferenceType) and `reference` parameters
* Add `getScreenshot` method to `Avatars` service
* Add `Theme`, `Timezone` and `Output` enums

## 12.3.0

* Add `total` parameter to list queries allowing skipping counting rows in a table for improved performance
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.3.0")
implementation("io.appwrite:sdk-for-kotlin:13.0.0")
```

### Maven
Expand All @@ -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.3.0</version>
<version>13.0.0</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/account/create-o-auth-2-token.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ account.createOAuth2Token(
OAuthProvider.AMAZON, // provider
"https://example.com", // success (optional)
"https://example.com", // failure (optional)
listOf(), // scopes (optional)
List.of(), // scopes (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/account/list-identities.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Client client = new Client()
Account account = new Account(client);

account.listIdentities(
listOf(), // queries (optional)
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/account/list-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Client client = new Client()
Account account = new Account(client);

account.listLogs(
listOf(), // queries (optional)
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
8 changes: 4 additions & 4 deletions docs/examples/java/account/update-prefs.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@ Client client = new Client()
Account account = new Account(client);

account.updatePrefs(
mapOf(
"language" to "en",
"timezone" to "UTC",
"darkTheme" to true
Map.of(
"language", "en",
"timezone", "UTC",
"darkTheme", true
), // prefs
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
48 changes: 48 additions & 0 deletions docs/examples/java/avatars/get-screenshot.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Avatars;
import io.appwrite.enums.Theme;
import io.appwrite.enums.Timezone;
import io.appwrite.enums.Output;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
.setProject("<YOUR_PROJECT_ID>") // Your project ID
.setSession(""); // The user session to authenticate with

Avatars avatars = new Avatars(client);

avatars.getScreenshot(
"https://example.com", // url
Map.of(
"Authorization", "Bearer token123",
"X-Custom-Header", "value"
), // headers (optional)
1920, // viewportWidth (optional)
1080, // viewportHeight (optional)
2, // scale (optional)
Theme.LIGHT, // theme (optional)
"Mozilla/5.0 (iPhone; CPU iPhone OS 14_0 like Mac OS X) AppleWebKit/605.1.15", // userAgent (optional)
true, // fullpage (optional)
"en-US", // locale (optional)
Timezone.AFRICA_ABIDJAN, // timezone (optional)
37.7749, // latitude (optional)
-122.4194, // longitude (optional)
100, // accuracy (optional)
true, // touch (optional)
List.of("geolocation", "notifications"), // permissions (optional)
3, // sleep (optional)
800, // width (optional)
600, // height (optional)
85, // quality (optional)
Output.JPG, // output (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

4 changes: 2 additions & 2 deletions docs/examples/java/databases/create-collection.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -15,7 +15,7 @@ databases.createCollection(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<NAME>", // name
listOf(Permission.read(Role.any())), // permissions (optional)
List.of(Permission.read(Role.any())), // permissions (optional)
false, // documentSecurity (optional)
false, // enabled (optional)
new CoroutineCallback<>((result, error) -> {
Expand Down
16 changes: 8 additions & 8 deletions docs/examples/java/databases/create-document.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -15,14 +15,14 @@ databases.createDocument(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
mapOf(
"username" to "walter.obrien",
"email" to "walter.obrien@example.com",
"fullName" to "Walter O'Brien",
"age" to 30,
"isAdmin" to false
Map.of(
"username", "walter.obrien",
"email", "walter.obrien@example.com",
"fullName", "Walter O'Brien",
"age", 30,
"isAdmin", false
), // data
listOf(Permission.read(Role.any())), // permissions (optional)
List.of(Permission.read(Role.any())), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/create-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Databases databases = new Databases(client);
databases.createDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // documents
List.of(), // documents
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/create-enum-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases.createEnumAttribute(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"", // key
listOf(), // elements
List.of(), // elements
false, // required
"<DEFAULT>", // default (optional)
false, // array (optional)
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/java/databases/create-index.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@ databases.createIndex(
"<COLLECTION_ID>", // collectionId
"", // key
IndexType.KEY, // type
listOf(), // attributes
listOf(), // orders (optional)
listOf(), // lengths (optional)
List.of(), // attributes
List.of(), // orders (optional)
List.of(), // lengths (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/create-line-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ databases.createLineAttribute(
"<COLLECTION_ID>", // collectionId
"", // key
false, // required
listOf([1, 2], [3, 4], [5, 6]), // default (optional)
List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6)), // default (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
20 changes: 9 additions & 11 deletions docs/examples/java/databases/create-operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,15 @@ Databases databases = new Databases(client);

databases.createOperations(
"<TRANSACTION_ID>", // transactionId
listOf(
{
"action": "create",
"databaseId": "<DATABASE_ID>",
"collectionId": "<COLLECTION_ID>",
"documentId": "<DOCUMENT_ID>",
"data": {
"name": "Walter O'Brien"
}
}
), // operations (optional)
List.of(Map.of(
"action", "create",
"databaseId", "<DATABASE_ID>",
"collectionId", "<COLLECTION_ID>",
"documentId", "<DOCUMENT_ID>",
"data", Map.of(
"name", "Walter O'Brien"
)
)), // operations (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/create-point-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ databases.createPointAttribute(
"<COLLECTION_ID>", // collectionId
"", // key
false, // required
listOf(1, 2), // default (optional)
List.of(1, 2), // default (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/create-polygon-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ databases.createPolygonAttribute(
"<COLLECTION_ID>", // collectionId
"", // key
false, // required
listOf([[1, 2], [3, 4], [5, 6], [1, 2]]), // default (optional)
List.of(List.of(List.of(1, 2), List.of(3, 4), List.of(5, 6), List.of(1, 2))), // default (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
import io.appwrite.enums.RelationshipType;
import io.appwrite.enums.RelationMutate;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/delete-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Databases databases = new Databases(client);
databases.deleteDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
List.of(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/get-document.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases.getDocument(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
listOf(), // queries (optional)
List.of(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list-attributes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Databases databases = new Databases(client);
databases.listAttributes(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list-collections.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Databases databases = new Databases(client);

databases.listCollections(
"<DATABASE_ID>", // databaseId
listOf(), // queries (optional)
List.of(), // queries (optional)
"<SEARCH>", // search (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Databases databases = new Databases(client);
databases.listDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
List.of(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list-indexes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Databases databases = new Databases(client);
databases.listIndexes(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
listOf(), // queries (optional)
List.of(), // queries (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list-transactions.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Client client = new Client()
Databases databases = new Databases(client);

databases.listTransactions(
listOf(), // queries (optional)
List.of(), // queries (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/list.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ Client client = new Client()
Databases databases = new Databases(client);

databases.list(
listOf(), // queries (optional)
List.of(), // queries (optional)
"<SEARCH>", // search (optional)
false, // total (optional)
new CoroutineCallback<>((result, error) -> {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/databases/update-collection.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -15,7 +15,7 @@ databases.updateCollection(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<NAME>", // name
listOf(Permission.read(Role.any())), // permissions (optional)
List.of(Permission.read(Role.any())), // permissions (optional)
false, // documentSecurity (optional)
false, // enabled (optional)
new CoroutineCallback<>((result, error) -> {
Expand Down
6 changes: 3 additions & 3 deletions docs/examples/java/databases/update-document.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Databases;
import io.appwrite.Permission;
import io.appwrite.Role;
import io.appwrite.services.Databases;

Client client = new Client()
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
Expand All @@ -15,8 +15,8 @@ databases.updateDocument(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"<DOCUMENT_ID>", // documentId
mapOf( "a" to "b" ), // data (optional)
listOf(Permission.read(Role.any())), // permissions (optional)
Map.of("a", "b"), // data (optional)
List.of(Permission.read(Role.any())), // permissions (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
4 changes: 2 additions & 2 deletions docs/examples/java/databases/update-documents.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ Databases databases = new Databases(client);
databases.updateDocuments(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
mapOf( "a" to "b" ), // data (optional)
listOf(), // queries (optional)
Map.of("a", "b"), // data (optional)
List.of(), // queries (optional)
"<TRANSACTION_ID>", // transactionId (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/databases/update-enum-attribute.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ databases.updateEnumAttribute(
"<DATABASE_ID>", // databaseId
"<COLLECTION_ID>", // collectionId
"", // key
listOf(), // elements
List.of(), // elements
false, // required
"<DEFAULT>", // default
"", // newKey (optional)
Expand Down
Loading