Skip to content

Commit a1564ee

Browse files
feat: introduce 0.15.x support
1 parent 46031d7 commit a1564ee

File tree

102 files changed

+1450
-349
lines changed

Some content is hidden

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

102 files changed

+1450
-349
lines changed

README.md

Lines changed: 4 additions & 4 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.14.0-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-0.15.0-blue.svg?style=flat-square)
66
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
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.14.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.15.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
@@ -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:0.5.0")
42+
implementation("io.appwrite:sdk-for-kotlin:0.6.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>0.5.0</version>
53+
<version>0.6.0</version>
5454
</dependency>
5555
</dependencies>
5656
```
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
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+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.createPhoneVerification(new Continuation<Response>() {
12+
@NotNull
13+
@Override
14+
public CoroutineContext getContext() {
15+
return EmptyCoroutineContext.INSTANCE;
16+
}
17+
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;
27+
}
28+
} catch (Throwable th) {
29+
Log.e("ERROR", th.toString());
30+
}
31+
}
32+
});
33+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
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+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.updatePhoneVerification(
12+
userId = "[USER_ID]",
13+
secret = "[SECRET]"
14+
new Continuation<Response>() {
15+
@NotNull
16+
@Override
17+
public CoroutineContext getContext() {
18+
return EmptyCoroutineContext.INSTANCE;
19+
}
20+
21+
@Override
22+
public void resumeWith(@NotNull Object o) {
23+
String json = "";
24+
try {
25+
if (o instanceof Result.Failure) {
26+
Result.Failure failure = (Result.Failure) o;
27+
throw failure.exception;
28+
} else {
29+
Response response = (Response) o;
30+
}
31+
} catch (Throwable th) {
32+
Log.e("ERROR", th.toString());
33+
}
34+
}
35+
}
36+
);
37+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import io.appwrite.Client
2+
import io.appwrite.services.Account
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+
.setJWT("eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJ..."); // Your secret JSON Web Token
9+
10+
Account account = new Account(client);
11+
account.updatePhone(
12+
number = "",
13+
password = "password"
14+
new Continuation<Response>() {
15+
@NotNull
16+
@Override
17+
public CoroutineContext getContext() {
18+
return EmptyCoroutineContext.INSTANCE;
19+
}
20+
21+
@Override
22+
public void resumeWith(@NotNull Object o) {
23+
String json = "";
24+
try {
25+
if (o instanceof Result.Failure) {
26+
Result.Failure failure = (Result.Failure) o;
27+
throw failure.exception;
28+
} else {
29+
Response response = (Response) o;
30+
}
31+
} catch (Throwable th) {
32+
Log.e("ERROR", th.toString());
33+
}
34+
}
35+
}
36+
);
37+
}

docs/examples/java/database/create-boolean-attribute.md renamed to docs/examples/java/databases/create-boolean-attribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createBooleanAttribute(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createBooleanAttribute(
1212
collectionId = "[COLLECTION_ID]",
1313
key = "",
1414
required = false,

docs/examples/java/database/create-collection.md renamed to docs/examples/java/databases/create-collection.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createCollection(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createCollection(
1212
collectionId = "[COLLECTION_ID]",
1313
name = "[NAME]",
1414
permission = "document",

docs/examples/java/database/create-document.md renamed to docs/examples/java/databases/create-document.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createDocument(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createDocument(
1212
collectionId = "[COLLECTION_ID]",
1313
documentId = "[DOCUMENT_ID]",
1414
data = mapOf( "a" to "b" ),

docs/examples/java/database/create-email-attribute.md renamed to docs/examples/java/databases/create-email-attribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createEmailAttribute(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createEmailAttribute(
1212
collectionId = "[COLLECTION_ID]",
1313
key = "",
1414
required = false,

docs/examples/java/database/create-enum-attribute.md renamed to docs/examples/java/databases/create-enum-attribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createEnumAttribute(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createEnumAttribute(
1212
collectionId = "[COLLECTION_ID]",
1313
key = "",
1414
elements = listOf(),

docs/examples/java/database/create-float-attribute.md renamed to docs/examples/java/databases/create-float-attribute.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
import io.appwrite.Client
2-
import io.appwrite.services.Database
2+
import io.appwrite.services.Databases
33

44
public void main() {
55
Client client = Client(context)
66
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
77
.setProject("5df5acd0d48c2") // Your project ID
88
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key
99

10-
Database database = new Database(client);
11-
database.createFloatAttribute(
10+
Databases databases = new Databases(client, "[DATABASE_ID]");
11+
databases.createFloatAttribute(
1212
collectionId = "[COLLECTION_ID]",
1313
key = "",
1414
required = false,

0 commit comments

Comments
 (0)