Skip to content

Commit

Permalink
chore: release rc
Browse files Browse the repository at this point in the history
  • Loading branch information
christyjacob4 committed Aug 17, 2024
1 parent 945e31c commit b1b2ad4
Show file tree
Hide file tree
Showing 22 changed files with 522 additions and 35 deletions.
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.5.7-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.6.0-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:5.0.2")
implementation("io.appwrite:sdk-for-kotlin:6.0.0-rc.1")
```

### 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>5.0.2</version>
<version>6.0.0-rc.1</version>
</dependency>
</dependencies>
```
Expand Down
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ ext {
POM_LICENSE_NAME = "GPL-3.0"
POM_DEVELOPER_ID = 'appwrite'
POM_DEVELOPER_NAME = 'Appwrite Team'
POM_DEVELOPER_EMAIL = 'team@appwrite.io'
POM_DEVELOPER_EMAIL = 'team@localhost.test'
GITHUB_SCM_CONNECTION = 'scm:git:git://github.com/appwrite/sdk-for-kotlin.git'
}

Expand Down
1 change: 0 additions & 1 deletion docs/examples/java/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Account account = new Account(client);

account.deleteMfaAuthenticator(
AuthenticatorType.TOTP, // type
"<OTP>", // otp
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
2 changes: 1 addition & 1 deletion docs/examples/java/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ functions.create(
"<TEMPLATE_REPOSITORY>", // templateRepository (optional)
"<TEMPLATE_OWNER>", // templateOwner (optional)
"<TEMPLATE_ROOT_DIRECTORY>", // templateRootDirectory (optional)
"<TEMPLATE_BRANCH>", // templateBranch (optional)
"<TEMPLATE_VERSION>", // templateVersion (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import io.appwrite.services.Functions;
Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID
.setKey("&lt;YOUR_API_KEY&gt;"); // Your secret API key
.setSession(""); // The user session to authenticate with

Functions functions = new Functions(client);

functions.downloadDeployment(
functions.getDeploymentDownload(
"<FUNCTION_ID>", // functionId
"<DEPLOYMENT_ID>", // deploymentId
new CoroutineCallback<>((result, error) -> {
Expand Down
22 changes: 22 additions & 0 deletions docs/examples/java/functions/get-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Functions;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;"); // Your project ID

Functions functions = new Functions(client);

functions.getTemplate(
"<TEMPLATE_ID>", // templateId
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

25 changes: 25 additions & 0 deletions docs/examples/java/functions/list-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
import io.appwrite.Client;
import io.appwrite.coroutines.CoroutineCallback;
import io.appwrite.services.Functions;

Client client = new Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;"); // Your project ID

Functions functions = new Functions(client);

functions.listTemplates(
listOf(), // runtimes (optional)
listOf(), // useCases (optional)
1, // limit (optional)
0, // offset (optional)
new CoroutineCallback<>((result, error) -> {
if (error != null) {
error.printStackTrace();
return;
}

System.out.println(result);
})
);

3 changes: 1 addition & 2 deletions docs/examples/kotlin/account/delete-mfa-authenticator.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,5 @@ val client = Client()
val account = Account(client)

val response = account.deleteMfaAuthenticator(
type = AuthenticatorType.TOTP,
otp = "<OTP>"
type = AuthenticatorType.TOTP
)
2 changes: 1 addition & 1 deletion docs/examples/kotlin/functions/create.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,5 @@ val response = functions.create(
templateRepository = "<TEMPLATE_REPOSITORY>", // optional
templateOwner = "<TEMPLATE_OWNER>", // optional
templateRootDirectory = "<TEMPLATE_ROOT_DIRECTORY>", // optional
templateBranch = "<TEMPLATE_BRANCH>" // optional
templateVersion = "<TEMPLATE_VERSION>" // optional
)
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,11 @@ import io.appwrite.services.Functions
val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID
.setKey("&lt;YOUR_API_KEY&gt;") // Your secret API key
.setSession("") // The user session to authenticate with

val functions = Functions(client)

val result = functions.downloadDeployment(
val result = functions.getDeploymentDownload(
functionId = "<FUNCTION_ID>",
deploymentId = "<DEPLOYMENT_ID>"
)
13 changes: 13 additions & 0 deletions docs/examples/kotlin/functions/get-template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Functions

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

val functions = Functions(client)

val response = functions.getTemplate(
templateId = "<TEMPLATE_ID>"
)
16 changes: 16 additions & 0 deletions docs/examples/kotlin/functions/list-templates.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import io.appwrite.Client
import io.appwrite.coroutines.CoroutineCallback
import io.appwrite.services.Functions

val client = Client()
.setEndpoint("https://cloud.appwrite.io/v1") // Your API Endpoint
.setProject("&lt;YOUR_PROJECT_ID&gt;") // Your project ID

val functions = Functions(client)

val response = functions.listTemplates(
runtimes = listOf(), // optional
useCases = listOf(), // optional
limit = 1, // optional
offset = 0 // optional
)
6 changes: 3 additions & 3 deletions src/main/kotlin/io/appwrite/Client.kt
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ class Client @JvmOverloads constructor(
init {
headers = mutableMapOf(
"content-type" to "application/json",
"user-agent" to "AppwriteKotlinSDK/5.0.2 ${System.getProperty("http.agent")}",
"user-agent" to "AppwriteKotlinSDK/6.0.0-rc.1 ${System.getProperty("http.agent")}",
"x-sdk-name" to "Kotlin",
"x-sdk-platform" to "server",
"x-sdk-language" to "kotlin",
"x-sdk-version" to "5.0.2",
"x-appwrite-response-format" to "1.5.0",
"x-sdk-version" to "6.0.0-rc.1",
"x-appwrite-response-format" to "1.6.0",
)

config = mutableMapOf()
Expand Down
8 changes: 8 additions & 0 deletions src/main/kotlin/io/appwrite/models/Execution.kt
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,12 @@ data class Execution(
@SerializedName("duration")
val duration: Double,

/**
* The scheduled time for execution. If left empty, execution will be queued immediately.
*/
@SerializedName("scheduledAt")
var scheduledAt: String?,

) {
fun toMap(): Map<String, Any> = mapOf(
"\$id" to id as Any,
Expand All @@ -121,6 +127,7 @@ data class Execution(
"logs" to logs as Any,
"errors" to errors as Any,
"duration" to duration as Any,
"scheduledAt" to scheduledAt as Any,
)

companion object {
Expand All @@ -145,6 +152,7 @@ data class Execution(
logs = map["logs"] as String,
errors = map["errors"] as String,
duration = (map["duration"] as Number).toDouble(),
scheduledAt = map["scheduledAt"] as? String?,
)
}
}
8 changes: 8 additions & 0 deletions src/main/kotlin/io/appwrite/models/Runtime.kt
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,12 @@ data class Runtime(
@SerializedName("\$id")
val id: String,

/**
* Parent runtime key.
*/
@SerializedName("key")
val key: String,

/**
* Runtime Name.
*/
Expand Down Expand Up @@ -52,6 +58,7 @@ data class Runtime(
) {
fun toMap(): Map<String, Any> = mapOf(
"\$id" to id as Any,
"key" to key as Any,
"name" to name as Any,
"version" to version as Any,
"base" to base as Any,
Expand All @@ -67,6 +74,7 @@ data class Runtime(
map: Map<String, Any>,
) = Runtime(
id = map["\$id"] as String,
key = map["key"] as String,
name = map["name"] as String,
version = map["version"] as String,
base = map["base"] as String,
Expand Down
Loading

0 comments on commit b1b2ad4

Please sign in to comment.