Skip to content

Commit c29826c

Browse files
Merge pull request #47 from appwrite/dev
fix: remove content-type from GET requests
2 parents 159d02d + f8697b5 commit c29826c

24 files changed

+49
-811
lines changed

README.md

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
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-1.6.1-blue.svg?style=flat-square)
5+
![Version](https://img.shields.io/badge/api%20version-1.6.2-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

@@ -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:7.0.0")
42+
implementation("io.appwrite:sdk-for-kotlin:8.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>7.0.0</version>
53+
<version>8.0.0</version>
5454
</dependency>
5555
</dependencies>
5656
```

docs/examples/java/databases/update-float-attribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ databases.updateFloatAttribute(
1414
"<COLLECTION_ID>", // collectionId
1515
"", // key
1616
false, // required
17-
0, // min
18-
0, // max
1917
0, // default
18+
0, // min (optional)
19+
0, // max (optional)
2020
"", // newKey (optional)
2121
new CoroutineCallback<>((result, error) -> {
2222
if (error != null) {

docs/examples/java/databases/update-integer-attribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ databases.updateIntegerAttribute(
1414
"<COLLECTION_ID>", // collectionId
1515
"", // key
1616
false, // required
17-
0, // min
18-
0, // max
1917
0, // default
18+
0, // min (optional)
19+
0, // max (optional)
2020
"", // newKey (optional)
2121
new CoroutineCallback<>((result, error) -> {
2222
if (error != null) {

docs/examples/java/health/get-queue-usage-dump.md renamed to docs/examples/java/health/get-queue-stats-resources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ Client client = new Client()
99

1010
Health health = new Health(client);
1111

12-
health.getQueueUsageDump(
12+
health.getQueueStatsResources(
1313
0, // threshold (optional)
1414
new CoroutineCallback<>((result, error) -> {
1515
if (error != null) {

docs/examples/java/health/get-queue.md

-19
This file was deleted.

docs/examples/kotlin/databases/update-float-attribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ val response = databases.updateFloatAttribute(
1414
collectionId = "<COLLECTION_ID>",
1515
key = "",
1616
required = false,
17-
min = 0,
18-
max = 0,
1917
default = 0,
18+
min = 0, // optional
19+
max = 0, // optional
2020
newKey = "" // optional
2121
)

docs/examples/kotlin/databases/update-integer-attribute.md

+2-2
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,8 @@ val response = databases.updateIntegerAttribute(
1414
collectionId = "<COLLECTION_ID>",
1515
key = "",
1616
required = false,
17-
min = 0,
18-
max = 0,
1917
default = 0,
18+
min = 0, // optional
19+
max = 0, // optional
2020
newKey = "" // optional
2121
)

docs/examples/kotlin/health/get-queue-usage-dump.md renamed to docs/examples/kotlin/health/get-queue-stats-resources.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ val client = Client()
99

1010
val health = Health(client)
1111

12-
val response = health.getQueueUsageDump(
12+
val response = health.getQueueStatsResources(
1313
threshold = 0 // optional
1414
)

docs/examples/kotlin/health/get-queue.md

-12
This file was deleted.

src/main/kotlin/io/appwrite/Client.kt

+10-4
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import java.io.BufferedReader
2121
import java.io.File
2222
import java.io.RandomAccessFile
2323
import java.io.IOException
24+
import java.lang.IllegalArgumentException
2425
import java.security.SecureRandom
2526
import java.security.cert.X509Certificate
2627
import javax.net.ssl.HostnameVerifier
@@ -57,11 +58,11 @@ class Client @JvmOverloads constructor(
5758
init {
5859
headers = mutableMapOf(
5960
"content-type" to "application/json",
60-
"user-agent" to "AppwriteKotlinSDK/7.0.0 ${System.getProperty("http.agent")}",
61+
"user-agent" to "AppwriteKotlinSDK/8.0.0 ${System.getProperty("http.agent")}",
6162
"x-sdk-name" to "Kotlin",
6263
"x-sdk-platform" to "server",
6364
"x-sdk-language" to "kotlin",
64-
"x-sdk-version" to "7.0.0",
65+
"x-sdk-version" to "8.0.0",
6566
"x-appwrite-response-format" to "1.6.0",
6667
)
6768

@@ -217,7 +218,12 @@ class Client @JvmOverloads constructor(
217218
*
218219
* @return this
219220
*/
221+
@Throws(IllegalArgumentException::class)
220222
fun setEndpoint(endPoint: String): Client {
223+
require(endPoint.startsWith("http://") || endPoint.startsWith("https://")) {
224+
"Invalid endpoint URL: $endPoint"
225+
}
226+
221227
this.endPoint = endPoint
222228
return this
223229
}
@@ -551,7 +557,7 @@ class Client @JvmOverloads constructor(
551557
body
552558
)
553559
} else {
554-
AppwriteException(body, response.code)
560+
AppwriteException(body, response.code, "", body)
555561
}
556562
it.cancel(error)
557563
return
@@ -602,7 +608,7 @@ class Client @JvmOverloads constructor(
602608
body
603609
)
604610
} else {
605-
AppwriteException(body, response.code)
611+
AppwriteException(body, response.code, "", body)
606612
}
607613
it.cancel(error)
608614
return

src/main/kotlin/io/appwrite/enums/CreditCard.kt

+3-1
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,9 @@ enum class CreditCard(val value: String) {
3434
@SerializedName("mir")
3535
MIR("mir"),
3636
@SerializedName("maestro")
37-
MAESTRO("maestro");
37+
MAESTRO("maestro"),
38+
@SerializedName("rupay")
39+
RUPAY("rupay");
3840

3941
override fun toString() = value
4042
}

src/main/kotlin/io/appwrite/enums/Name.kt

+4-4
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,10 @@ enum class Name(val value: String) {
1313
V1_MAILS("v1-mails"),
1414
@SerializedName("v1-functions")
1515
V1_FUNCTIONS("v1-functions"),
16-
@SerializedName("v1-usage")
17-
V1_USAGE("v1-usage"),
18-
@SerializedName("v1-usage-dump")
19-
V1_USAGE_DUMP("v1-usage-dump"),
16+
@SerializedName("v1-stats-resources")
17+
V1_STATS_RESOURCES("v1-stats-resources"),
18+
@SerializedName("v1-stats-usage")
19+
V1_STATS_USAGE("v1-stats-usage"),
2020
@SerializedName("v1-webhooks")
2121
V1_WEBHOOKS("v1-webhooks"),
2222
@SerializedName("v1-certificates")

src/main/kotlin/io/appwrite/enums/OAuthProvider.kt

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ enum class OAuthProvider(val value: String) {
3131
ETSY("etsy"),
3232
@SerializedName("facebook")
3333
FACEBOOK("facebook"),
34+
@SerializedName("figma")
35+
FIGMA("figma"),
3436
@SerializedName("github")
3537
GITHUB("github"),
3638
@SerializedName("gitlab")

0 commit comments

Comments
 (0)