2022-06-21 20:03:50 +12:00
|
|
|
import io.appwrite.Client
|
2022-08-30 00:09:22 +12:00
|
|
|
import io.appwrite.models.InputFile
|
2022-06-21 20:03:50 +12:00
|
|
|
import io.appwrite.services.Functions
|
|
|
|
|
|
|
|
suspend fun main() {
|
|
|
|
val client = Client(context)
|
|
|
|
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
|
|
|
.setProject("5df5acd0d48c2") // Your project ID
|
|
|
|
.setKey("919c2d18fb5d4...a2ae413da83346ad2") // Your secret API key
|
|
|
|
|
|
|
|
val functions = Functions(client)
|
|
|
|
val response = functions.createDeployment(
|
|
|
|
functionId = "[FUNCTION_ID]",
|
|
|
|
entrypoint = "[ENTRYPOINT]",
|
2022-06-28 23:21:28 +12:00
|
|
|
code = InputFile.fromPath("file.png"),
|
2022-06-21 20:03:50 +12:00
|
|
|
activate = false
|
|
|
|
)
|
|
|
|
val json = response.body?.string()
|
|
|
|
}
|