Skip to content

Commit 1e1a501

Browse files
committed
Fix Java endpoint setter
1 parent f509a5f commit 1e1a501

File tree

3 files changed

+23
-11
lines changed

3 files changed

+23
-11
lines changed

mock-server/app/http.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
6565
->inject('response')
6666
->action(function (UtopiaSwooleResponse $response) {
67-
$response->json([ 'version' => '1.0.0' ]);
67+
$response->json([ 'version' => '1.5.7' ]);
6868
});
6969

7070
// Mock Routes

templates/android/library/src/main/java/io/package/Client.kt.twig

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -36,19 +36,25 @@ import javax.net.ssl.X509TrustManager
3636
import kotlin.coroutines.CoroutineContext
3737
import kotlin.coroutines.resume
3838

39-
class Client @JvmOverloads constructor(
40-
context: Context,
41-
var endpoint: String = "{{spec.endpoint}}",
42-
var endpointRealtime: String? = null,
43-
private var selfSigned: Boolean = false
44-
) : CoroutineScope {
39+
class Client(context: Context) : CoroutineScope {
4540

4641
companion object {
4742
internal const val CHUNK_SIZE = 5*1024*1024; // 5MB
4843
internal const val GLOBAL_PREFS = "{{ sdk.namespace | caseDot }}"
4944
internal const val COOKIE_PREFS = "myCookie"
5045
}
5146

47+
private var _endpoint: String = ""
48+
var endpoint: String
49+
get() = _endpoint
50+
private set(value) {
51+
_endpoint = value
52+
}
53+
54+
private var endpointRealtime: String? = null
55+
56+
private var selfSigned: Boolean = false
57+
5258
override val coroutineContext: CoroutineContext
5359
get() = Dispatchers.Main + job
5460

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

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,15 +31,21 @@ import javax.net.ssl.X509TrustManager
3131
import kotlin.coroutines.CoroutineContext
3232
import kotlin.coroutines.resume
3333

34-
class Client @JvmOverloads constructor(
35-
var endPoint: String = "{{spec.endpoint}}",
36-
private var selfSigned: Boolean = false
37-
) : CoroutineScope {
34+
class Client: CoroutineScope {
3835

3936
companion object {
4037
const val CHUNK_SIZE = 5*1024*1024; // 5MB
4138
}
4239

40+
private var _endpoint: String = ""
41+
var endpoint: String
42+
get() = _endpoint
43+
private set(value) {
44+
_endpoint = value
45+
}
46+
47+
private var selfSigned: Boolean = false
48+
4349
override val coroutineContext: CoroutineContext
4450
get() = Dispatchers.Main + job
4551

0 commit comments

Comments
 (0)