Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix between query output #35

Merged
merged 2 commits into from
Nov 20, 2023
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
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

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

Expand Down 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:4.0.0")
implementation("io.appwrite:sdk-for-kotlin:4.1.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>4.0.0</version>
<version>4.1.0</version>
</dependency>
</dependencies>
```
Expand Down
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueBuilds(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
16 changes: 9 additions & 7 deletions docs/examples/java/health/get-queue-certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Client client = new Client()

Health health = new Health(client);

health.getQueueCertificates(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
health.getQueueCertificates(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
}));
System.out.println(result);
})
);
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-databases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueDatabases(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-deletes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueDeletes(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
16 changes: 9 additions & 7 deletions docs/examples/java/health/get-queue-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Client client = new Client()

Health health = new Health(client);

health.getQueueFunctions(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
health.getQueueFunctions(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
}));
System.out.println(result);
})
);
16 changes: 9 additions & 7 deletions docs/examples/java/health/get-queue-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Client client = new Client()

Health health = new Health(client);

health.getQueueLogs(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
health.getQueueLogs(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
}));
System.out.println(result);
})
);
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-mails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueMails(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueMessaging(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
21 changes: 21 additions & 0 deletions docs/examples/java/health/get-queue-migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Health;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2"); // Your secret API key

Health health = new Health(client);

health.getQueueMigrations(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);
16 changes: 9 additions & 7 deletions docs/examples/java/health/get-queue-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,13 @@ Client client = new Client()

Health health = new Health(client);

health.getQueueWebhooks(new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}
health.getQueueWebhooks(
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
}));
System.out.println(result);
})
);
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-builds.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueBuilds(
)
3 changes: 2 additions & 1 deletion docs/examples/kotlin/health/get-queue-certificates.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ val client = Client(context)

val health = Health(client)

val response = health.getQueueCertificates()
val response = health.getQueueCertificates(
)
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-databases.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueDatabases(
)
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-deletes.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueDeletes(
)
3 changes: 2 additions & 1 deletion docs/examples/kotlin/health/get-queue-functions.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ val client = Client(context)

val health = Health(client)

val response = health.getQueueFunctions()
val response = health.getQueueFunctions(
)
3 changes: 2 additions & 1 deletion docs/examples/kotlin/health/get-queue-logs.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ val client = Client(context)

val health = Health(client)

val response = health.getQueueLogs()
val response = health.getQueueLogs(
)
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-mails.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueMails(
)
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-messaging.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueMessaging(
)
12 changes: 12 additions & 0 deletions docs/examples/kotlin/health/get-queue-migrations.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import io.appwrite.Client
import io.appwrite.services.Health

val client = Client(context)
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("5df5acd0d48c2") // Your project ID
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key

val health = Health(client)

val response = health.getQueueMigrations(
)
3 changes: 2 additions & 1 deletion docs/examples/kotlin/health/get-queue-webhooks.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,5 @@ val client = Client(context)

val health = Health(client)

val response = health.getQueueWebhooks()
val response = health.getQueueWebhooks(
)
4 changes: 2 additions & 2 deletions src/main/kotlin/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -62,11 +62,11 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/4.0.0 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/4.1.0 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "4.0.0", "x-appwrite-response-format" to "1.4.0"
"x-sdk-version" to "4.1.0", "x-appwrite-response-format" to "1.4.0"
)
config = mutableMapOf()

Expand Down
6 changes: 3 additions & 3 deletions src/main/kotlin/io/appwrite/Query.kt
Original file line number Diff line number Diff line change
Expand Up @@ -20,11 +20,11 @@ class Query {

fun isNotNull(attribute: String) = "isNotNull(\"${attribute}\")"

fun between(attribute: String, start: Int, end: Int) = Query.addQuery(attribute, "between", listOf(start, end))
fun between(attribute: String, start: Int, end: Int) = "between(\"${attribute}\", ${start}, ${end})"

fun between(attribute: String, start: Double, end: Double) = Query.addQuery(attribute, "between", listOf(start, end))
fun between(attribute: String, start: Double, end: Double) = "between(\"${attribute}\", ${start}, ${end})"

fun between(attribute: String, start: String, end: String) = Query.addQuery(attribute, "between", listOf(start, end))
fun between(attribute: String, start: String, end: String) = "between(\"${attribute}\", \"${start}\", \"${end}\")"

fun startsWith(attribute: String, value: String) = Query.addQuery(attribute, "startsWith", value)

Expand Down
4 changes: 2 additions & 2 deletions src/main/kotlin/io/appwrite/models/Bucket.kt
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ data class Bucket(
val updatedAt: String,

/**
* Bucket permissions. [Learn more about permissions](/docs/permissions).
* Bucket permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
*/
@SerializedName("\$permissions")
val permissions: List<Any>,

/**
* Whether file-level security is enabled. [Learn more about permissions](/docs/permissions).
* Whether file-level security is enabled. [Learn more about permissions](https://appwrite.io/docs/permissions).
*/
@SerializedName("fileSecurity")
val fileSecurity: Boolean,
Expand Down
Loading