File tree 22 files changed +522
-35
lines changed
src/main/kotlin/io/appwrite
22 files changed +522
-35
lines changed Original file line number Diff line number Diff line change 2
2
3
3
![ Maven Central] ( https://img.shields.io/maven-central/v/io.appwrite/sdk-for-kotlin.svg?color=green&style=flat-square )
4
4
![ 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.5.7 -blue.svg?style=flat-square )
5
+ ![ Version] ( https://img.shields.io/badge/api%20version-1.6.0 -blue.svg?style=flat-square )
6
6
[ ![ Twitter Account] ( https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square )] ( https://twitter.com/appwrite )
7
7
[ ![ Discord] ( https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square )] ( https://appwrite.io/discord )
8
8
@@ -39,7 +39,7 @@ repositories {
39
39
Next, add the dependency to your project's ` build.gradle(.kts) ` file:
40
40
41
41
``` groovy
42
- implementation("io.appwrite:sdk-for-kotlin:5 .0.2 ")
42
+ implementation("io.appwrite:sdk-for-kotlin:6 .0.0-rc.1 ")
43
43
```
44
44
45
45
### Maven
@@ -50,7 +50,7 @@ Add this to your project's `pom.xml` file:
50
50
<dependency >
51
51
<groupId >io.appwrite</groupId >
52
52
<artifactId >sdk-for-kotlin</artifactId >
53
- <version >5 .0.2 </version >
53
+ <version >6 .0.0-rc.1 </version >
54
54
</dependency >
55
55
</dependencies >
56
56
```
Original file line number Diff line number Diff line change 18
18
POM_LICENSE_NAME = " GPL-3.0"
19
19
POM_DEVELOPER_ID = ' appwrite'
20
20
POM_DEVELOPER_NAME = ' Appwrite Team'
21
- POM_DEVELOPER_EMAIL = ' team@appwrite.io '
21
+ POM_DEVELOPER_EMAIL = ' team@localhost.test '
22
22
GITHUB_SCM_CONNECTION = ' scm:git:git://github.com/appwrite/sdk-for-kotlin.git'
23
23
}
24
24
Original file line number Diff line number Diff line change @@ -12,7 +12,6 @@ Account account = new Account(client);
12
12
13
13
account.deleteMfaAuthenticator(
14
14
AuthenticatorType.TOTP, // type
15
- "<OTP >", // otp
16
15
new CoroutineCallback<>((result, error) -> {
17
16
if (error != null) {
18
17
error.printStackTrace();
Original file line number Diff line number Diff line change @@ -31,7 +31,7 @@ functions.create(
31
31
"<TEMPLATE_REPOSITORY>", // templateRepository (optional)
32
32
"<TEMPLATE_OWNER>", // templateOwner (optional)
33
33
"<TEMPLATE_ROOT_DIRECTORY>", // templateRootDirectory (optional)
34
- "<TEMPLATE_BRANCH >", // templateBranch (optional)
34
+ "<TEMPLATE_VERSION >", // templateVersion (optional)
35
35
new CoroutineCallback<>((result, error) -> {
36
36
if (error != null) {
37
37
error.printStackTrace();
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import io.appwrite.services.Functions;
5
5
Client client = new Client()
6
6
.setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
7
.setProject("< ; YOUR_PROJECT_ID> ; ") // Your project ID
8
- .setKey(" & lt ; YOUR_API_KEY & gt ; "); // Your secret API key
8
+ .setSession(" "); // The user session to authenticate with
9
9
10
10
Functions functions = new Functions(client);
11
11
12
- functions.downloadDeployment (
12
+ functions.getDeploymentDownload (
13
13
"<FUNCTION_ID>", // functionId
14
14
"<DEPLOYMENT_ID>", // deploymentId
15
15
new CoroutineCallback<>((result, error) -> {
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Functions;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
+ .setProject("< ; YOUR_PROJECT_ID> ; "); // Your project ID
8
+
9
+ Functions functions = new Functions(client);
10
+
11
+ functions.getTemplate(
12
+ "<TEMPLATE_ID>", // templateId
13
+ new CoroutineCallback<>((result, error) -> {
14
+ if (error != null) {
15
+ error.printStackTrace();
16
+ return;
17
+ }
18
+
19
+ System.out.println(result);
20
+ })
21
+ );
22
+
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client;
2
+ import io.appwrite.coroutines.CoroutineCallback;
3
+ import io.appwrite.services.Functions;
4
+
5
+ Client client = new Client()
6
+ .setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
+ .setProject("< ; YOUR_PROJECT_ID> ; "); // Your project ID
8
+
9
+ Functions functions = new Functions(client);
10
+
11
+ functions.listTemplates(
12
+ listOf(), // runtimes (optional)
13
+ listOf(), // useCases (optional)
14
+ 1, // limit (optional)
15
+ 0, // offset (optional)
16
+ new CoroutineCallback<>((result, error) -> {
17
+ if (error != null) {
18
+ error.printStackTrace();
19
+ return;
20
+ }
21
+
22
+ System.out.println(result);
23
+ })
24
+ );
25
+
Original file line number Diff line number Diff line change @@ -11,6 +11,5 @@ val client = Client()
11
11
val account = Account(client)
12
12
13
13
val response = account.deleteMfaAuthenticator(
14
- type = AuthenticatorType.TOTP,
15
- otp = "<OTP >"
14
+ type = AuthenticatorType.TOTP
16
15
)
Original file line number Diff line number Diff line change @@ -31,5 +31,5 @@ val response = functions.create(
31
31
templateRepository = "<TEMPLATE_REPOSITORY>", // optional
32
32
templateOwner = "<TEMPLATE_OWNER>", // optional
33
33
templateRootDirectory = "<TEMPLATE_ROOT_DIRECTORY>", // optional
34
- templateBranch = "<TEMPLATE_BRANCH >" // optional
34
+ templateVersion = "<TEMPLATE_VERSION >" // optional
35
35
)
Original file line number Diff line number Diff line change @@ -5,11 +5,11 @@ import io.appwrite.services.Functions
5
5
val client = Client()
6
6
.setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
7
.setProject("< ; YOUR_PROJECT_ID> ; ") // Your project ID
8
- .setKey(" & lt ; YOUR_API_KEY & gt ; ") // Your secret API key
8
+ .setSession(" ") // The user session to authenticate with
9
9
10
10
val functions = Functions(client)
11
11
12
- val result = functions.downloadDeployment (
12
+ val result = functions.getDeploymentDownload (
13
13
functionId = "<FUNCTION_ID>",
14
14
deploymentId = "<DEPLOYMENT_ID>"
15
15
)
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Functions
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
+ .setProject("< ; YOUR_PROJECT_ID> ; ") // Your project ID
8
+
9
+ val functions = Functions(client)
10
+
11
+ val response = functions.getTemplate(
12
+ templateId = "<TEMPLATE_ID>"
13
+ )
Original file line number Diff line number Diff line change
1
+ import io.appwrite.Client
2
+ import io.appwrite.coroutines.CoroutineCallback
3
+ import io.appwrite.services.Functions
4
+
5
+ val client = Client()
6
+ .setEndpoint("https://cloud.appwrite.io/v1 ") // Your API Endpoint
7
+ .setProject("< ; YOUR_PROJECT_ID> ; ") // Your project ID
8
+
9
+ val functions = Functions(client)
10
+
11
+ val response = functions.listTemplates(
12
+ runtimes = listOf(), // optional
13
+ useCases = listOf(), // optional
14
+ limit = 1, // optional
15
+ offset = 0 // optional
16
+ )
Original file line number Diff line number Diff line change @@ -57,12 +57,12 @@ class Client @JvmOverloads constructor(
57
57
init {
58
58
headers = mutableMapOf (
59
59
" content-type" to " application/json" ,
60
- " user-agent" to " AppwriteKotlinSDK/5 .0.2 ${System .getProperty(" http.agent" )} " ,
60
+ " user-agent" to " AppwriteKotlinSDK/6 .0.0-rc.1 ${System .getProperty(" http.agent" )} " ,
61
61
" x-sdk-name" to " Kotlin" ,
62
62
" x-sdk-platform" to " server" ,
63
63
" x-sdk-language" to " kotlin" ,
64
- " x-sdk-version" to " 5 .0.2 " ,
65
- " x-appwrite-response-format" to " 1.5 .0" ,
64
+ " x-sdk-version" to " 6 .0.0-rc.1 " ,
65
+ " x-appwrite-response-format" to " 1.6 .0" ,
66
66
)
67
67
68
68
config = mutableMapOf ()
Original file line number Diff line number Diff line change @@ -103,6 +103,12 @@ data class Execution(
103
103
@SerializedName(" duration" )
104
104
val duration : Double ,
105
105
106
+ /* *
107
+ * The scheduled time for execution. If left empty, execution will be queued immediately.
108
+ */
109
+ @SerializedName(" scheduledAt" )
110
+ var scheduledAt : String? ,
111
+
106
112
) {
107
113
fun toMap (): Map <String , Any > = mapOf (
108
114
" \$ id" to id as Any ,
@@ -121,6 +127,7 @@ data class Execution(
121
127
" logs" to logs as Any ,
122
128
" errors" to errors as Any ,
123
129
" duration" to duration as Any ,
130
+ " scheduledAt" to scheduledAt as Any ,
124
131
)
125
132
126
133
companion object {
@@ -145,6 +152,7 @@ data class Execution(
145
152
logs = map[" logs" ] as String ,
146
153
errors = map[" errors" ] as String ,
147
154
duration = (map[" duration" ] as Number ).toDouble(),
155
+ scheduledAt = map[" scheduledAt" ] as ? String? ,
148
156
)
149
157
}
150
158
}
Original file line number Diff line number Diff line change @@ -13,6 +13,12 @@ data class Runtime(
13
13
@SerializedName(" \$ id" )
14
14
val id : String ,
15
15
16
+ /* *
17
+ * Parent runtime key.
18
+ */
19
+ @SerializedName(" key" )
20
+ val key : String ,
21
+
16
22
/* *
17
23
* Runtime Name.
18
24
*/
@@ -52,6 +58,7 @@ data class Runtime(
52
58
) {
53
59
fun toMap (): Map <String , Any > = mapOf (
54
60
" \$ id" to id as Any ,
61
+ " key" to key as Any ,
55
62
" name" to name as Any ,
56
63
" version" to version as Any ,
57
64
" base" to base as Any ,
@@ -67,6 +74,7 @@ data class Runtime(
67
74
map : Map <String , Any >,
68
75
) = Runtime (
69
76
id = map[" \$ id" ] as String ,
77
+ key = map[" key" ] as String ,
70
78
name = map[" name" ] as String ,
71
79
version = map[" version" ] as String ,
72
80
base = map[" base" ] as String ,
You can’t perform that action at this time.
0 commit comments