Merge pull request #31 from appwrite/dev

Fix oauth2 issues
This commit is contained in:
Jake Barnby
2023-02-17 13:51:00 +13:00
committed by GitHub
12 changed files with 141 additions and 130 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2023 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
+3 -3
View File
@@ -2,7 +2,7 @@
![Maven Central](https://img.shields.io/maven-central/v/io.appwrite/sdk-for-android.svg?color=green&style=flat-square)
![License](https://img.shields.io/github/license/appwrite/sdk-for-android.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.2.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-1.2.1-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![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)
@@ -38,7 +38,7 @@ repositories {
Next, add the dependency to your project's `build.gradle(.kts)` file:
```groovy
implementation("io.appwrite:sdk-for-android:1.2.0")
implementation("io.appwrite:sdk-for-android:1.2.1")
```
### Maven
@@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file:
<dependency>
<groupId>io.appwrite</groupId>
<artifactId>sdk-for-android</artifactId>
<version>1.2.0</version>
<version>1.2.1</version>
</dependency>
</dependencies>
```
+1 -1
View File
@@ -88,7 +88,7 @@ class Client @JvmOverloads constructor(
"x-sdk-name" to "Android",
"x-sdk-platform" to "client",
"x-sdk-language" to "android",
"x-sdk-version" to "1.2.0",
"x-sdk-version" to "1.2.1",
"x-appwrite-response-format" to "1.0.0"
)
config = mutableMapOf()
@@ -38,7 +38,7 @@ data class Locale(
val continent: String,
/**
* True if country is part of the Europian Union.
* True if country is part of the European Union.
*/
@SerializedName("eu")
val eu: Boolean,
@@ -37,8 +37,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"GET",
path,
@@ -67,7 +67,7 @@ class Account : Service {
*
* Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/client/account#accountCreateSession).
*
* @param userId Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param email User email.
* @param password User password. Must be at least 8 chars.
* @param name User name. Max length: 128 chars.
@@ -93,8 +93,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"POST",
path,
@@ -110,7 +110,7 @@ class Account : Service {
*
* Use this endpoint to allow a new user to register a new account in your project. After the user registration completes successfully, you can use the [/account/verfication](/docs/client/account#accountCreateVerification) route to start verifying the user email address. To allow the new user to login to their new account, you need to create a new [account session](/docs/client/account#accountCreateSession).
*
* @param userId Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param email User email.
* @param password User password. Must be at least 8 chars.
* @param name User name. Max length: 128 chars.
@@ -155,8 +155,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -203,8 +203,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Jwt = {
io.appwrite.models.Jwt.from(map = it as Map<String, Any>)
}
io.appwrite.models.Jwt.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -237,8 +237,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.LogList = {
io.appwrite.models.LogList.from(map = it as Map<String, Any>)
}
io.appwrite.models.LogList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -271,8 +271,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -324,8 +324,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -380,8 +380,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -429,8 +429,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Preferences<T> = {
io.appwrite.models.Preferences.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Preferences.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"GET",
path,
@@ -475,8 +475,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -526,8 +526,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -568,8 +568,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -598,8 +598,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.SessionList = {
io.appwrite.models.SessionList.from(map = it as Map<String, Any>)
}
io.appwrite.models.SessionList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -654,8 +654,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -690,8 +690,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -708,7 +708,7 @@ class Account : Service {
*
* Sends the user an email with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. When the user clicks the link in the email, the user is redirected back to the URL you provided with the secret key and userId values attached to the URL query string. Use the query string parameters to submit a request to the [PUT /account/sessions/magic-url](/docs/client/account#accountUpdateMagicURLSession) endpoint to complete the login process. The link sent to the user&#039;s email address is valid for 1 hour. If you are on a mobile device you can leave the URL parameter empty, so that the login completion will be handled by your Appwrite instance by default.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](/docs/authentication#limits).
*
* @param userId Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param email User email.
* @param url URL to redirect the user back to your app from the magic URL login. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.
* @return [io.appwrite.models.Token]
@@ -730,8 +730,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -766,8 +766,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -804,6 +804,7 @@ class Account : Service {
"success" to success,
"failure" to failure,
"scopes" to scopes,
"project" to client.config["project"],
)
val query = mutableListOf<String>()
params.forEach {
@@ -855,7 +856,7 @@ class Account : Service {
*
* Sends the user an SMS with a secret key for creating a session. If the provided user ID has not be registered, a new user will be created. Use the returned user ID and secret and submit a request to the [PUT /account/sessions/phone](/docs/client/account#accountUpdatePhoneSession) endpoint to complete the login process. The secret sent to the user&#039;s phone is valid for 15 minutes.A user is limited to 10 active sessions at a time by default. [Learn more about session limits](/docs/authentication#limits).
*
* @param userId Unique Id. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param userId Unique Id. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param phone Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
* @return [io.appwrite.models.Token]
*/
@@ -873,8 +874,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -909,8 +910,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -942,8 +943,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -975,8 +976,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Session = {
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
io.appwrite.models.Session.from(map = it as Map<String, Any>)
}
return client.call(
"PATCH",
path,
@@ -1035,8 +1036,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Account<T> = {
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Account.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -1080,8 +1081,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -1116,8 +1117,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -1146,8 +1147,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -1182,8 +1183,8 @@ class Account : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Token = {
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
io.appwrite.models.Token.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -42,6 +42,7 @@ class Avatars : Service {
"width" to width,
"height" to height,
"quality" to quality,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -77,6 +78,7 @@ class Avatars : Service {
"width" to width,
"height" to height,
"quality" to quality,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -102,6 +104,7 @@ class Avatars : Service {
val params = mutableMapOf<String, Any?>(
"url" to url,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -137,6 +140,7 @@ class Avatars : Service {
"width" to width,
"height" to height,
"quality" to quality,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -169,6 +173,7 @@ class Avatars : Service {
"url" to url,
"width" to width,
"height" to height,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -204,6 +209,7 @@ class Avatars : Service {
"width" to width,
"height" to height,
"background" to background,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -239,6 +245,7 @@ class Avatars : Service {
"size" to size,
"margin" to margin,
"download" to download,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -43,8 +43,8 @@ class Databases : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.DocumentList<T> = {
io.appwrite.models.DocumentList.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.DocumentList.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"GET",
path,
@@ -85,9 +85,9 @@ class Databases : Service {
*
* @param databaseId Database ID.
* @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
* @param documentId Document ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param data Document data as JSON object.
* @param permissions An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.Document<T>]
*/
@JvmOverloads
@@ -112,8 +112,8 @@ class Databases : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Document<T> = {
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"POST",
path,
@@ -131,9 +131,9 @@ class Databases : Service {
*
* @param databaseId Database ID.
* @param collectionId Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
* @param documentId Document ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param documentId Document ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param data Document data as JSON object.
* @param permissions An array of permissions strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.Document<T>]
*/
@JvmOverloads
@@ -180,8 +180,8 @@ class Databases : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Document<T> = {
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"GET",
path,
@@ -223,7 +223,7 @@ class Databases : Service {
* @param collectionId Collection ID.
* @param documentId Document ID.
* @param data Document data as JSON object. Include only attribute and value pairs to be updated.
* @param permissions An array of permissions strings. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.Document<T>]
*/
@JvmOverloads
@@ -248,8 +248,8 @@ class Databases : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Document<T> = {
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
io.appwrite.models.Document.from(map = it as Map<String, Any>, nestedType)
}
return client.call(
"PATCH",
path,
@@ -269,7 +269,7 @@ class Databases : Service {
* @param collectionId Collection ID.
* @param documentId Document ID.
* @param data Document data as JSON object. Include only attribute and value pairs to be updated.
* @param permissions An array of permissions strings. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.Document<T>]
*/
@JvmOverloads
@@ -42,8 +42,8 @@ class Functions : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.ExecutionList = {
io.appwrite.models.ExecutionList.from(map = it as Map<String, Any>)
}
io.appwrite.models.ExecutionList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -82,8 +82,8 @@ class Functions : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Execution = {
io.appwrite.models.Execution.from(map = it as Map<String, Any>)
}
io.appwrite.models.Execution.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -118,8 +118,8 @@ class Functions : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Execution = {
io.appwrite.models.Execution.from(map = it as Map<String, Any>)
}
io.appwrite.models.Execution.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -36,8 +36,8 @@ class Graphql : Service {
"content-type" to "application/json",
)
val converter: (Any) -> Any = {
it
}
it
}
return client.call(
"POST",
path,
@@ -70,8 +70,8 @@ class Graphql : Service {
"content-type" to "application/json",
)
val converter: (Any) -> Any = {
it
}
it
}
return client.call(
"POST",
path,
@@ -32,8 +32,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Locale = {
io.appwrite.models.Locale.from(map = it as Map<String, Any>)
}
io.appwrite.models.Locale.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -62,8 +62,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.ContinentList = {
io.appwrite.models.ContinentList.from(map = it as Map<String, Any>)
}
io.appwrite.models.ContinentList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -92,8 +92,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.CountryList = {
io.appwrite.models.CountryList.from(map = it as Map<String, Any>)
}
io.appwrite.models.CountryList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -122,8 +122,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.CountryList = {
io.appwrite.models.CountryList.from(map = it as Map<String, Any>)
}
io.appwrite.models.CountryList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -152,8 +152,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.PhoneList = {
io.appwrite.models.PhoneList.from(map = it as Map<String, Any>)
}
io.appwrite.models.PhoneList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -182,8 +182,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.CurrencyList = {
io.appwrite.models.CurrencyList.from(map = it as Map<String, Any>)
}
io.appwrite.models.CurrencyList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -212,8 +212,8 @@ class Locale : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.LanguageList = {
io.appwrite.models.LanguageList.from(map = it as Map<String, Any>)
}
io.appwrite.models.LanguageList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -44,8 +44,8 @@ class Storage : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.FileList = {
io.appwrite.models.FileList.from(map = it as Map<String, Any>)
}
io.appwrite.models.FileList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -63,9 +63,9 @@ class Storage : Service {
* Create a new file. Before using this route, you should create a new bucket resource using either a [server integration](/docs/server/storage#storageCreateBucket) API or directly from your Appwrite console.Larger files should be uploaded using multiple requests with the [content-range](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Content-Range) header to send a partial request with a maximum supported chunk of `5MB`. The `content-range` header values should always be in bytes.When the first request is sent, the server will return the **File** object, and the subsequent part request must include the file&#039;s **id** in `x-appwrite-id` header to allow the server to know that the partial upload is for the existing file and not for a new one.If you&#039;re creating a new file using one of the Appwrite SDKs, all the chunking logic will be managed by the SDK internally.
*
* @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
* @param fileId File ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param fileId File ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param file Binary file.
* @param permissions An array of permission strings. By default the current user is granted with all permissions. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permission strings. By default, only the current user is granted all permissions. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.File]
*/
@JvmOverloads
@@ -88,8 +88,8 @@ class Storage : Service {
"content-type" to "multipart/form-data",
)
val converter: (Any) -> io.appwrite.models.File = {
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
val idParamName: String? = "fileId"
val paramName = "file"
return client.chunkedUpload(
@@ -128,8 +128,8 @@ class Storage : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.File = {
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -148,7 +148,7 @@ class Storage : Service {
*
* @param bucketId Storage bucket unique ID. You can create a new storage bucket using the Storage service [server integration](/docs/server/storage#createBucket).
* @param fileId File unique ID.
* @param permissions An array of permission string. By default the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @param permissions An array of permission string. By default, the current permissions are inherited. [Learn more about permissions](/docs/permissions).
* @return [io.appwrite.models.File]
*/
@JvmOverloads
@@ -168,8 +168,8 @@ class Storage : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.File = {
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
io.appwrite.models.File.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -231,6 +231,7 @@ class Storage : Service {
.replace("{fileId}", fileId)
val params = mutableMapOf<String, Any?>(
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -293,6 +294,7 @@ class Storage : Service {
"rotation" to rotation,
"background" to background,
"output" to output,
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -321,6 +323,7 @@ class Storage : Service {
.replace("{fileId}", fileId)
val params = mutableMapOf<String, Any?>(
"project" to client.config["project"],
)
return client.call(
"GET",
@@ -39,8 +39,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.TeamList = {
io.appwrite.models.TeamList.from(map = it as Map<String, Any>)
}
io.appwrite.models.TeamList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -57,7 +57,7 @@ class Teams : Service {
*
* Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.
*
* @param teamId Team ID. Choose your own unique ID or pass the string `ID.unique()` to auto generate it. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param teamId Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
* @param name Team name. Max length: 128 chars.
* @param roles Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
* @return [io.appwrite.models.Team]
@@ -79,8 +79,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Team = {
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -112,8 +112,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Team = {
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -148,8 +148,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Team = {
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
io.appwrite.models.Team.from(map = it as Map<String, Any>)
}
return client.call(
"PUT",
path,
@@ -217,8 +217,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.MembershipList = {
io.appwrite.models.MembershipList.from(map = it as Map<String, Any>)
}
io.appwrite.models.MembershipList.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -263,8 +263,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Membership = {
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
return client.call(
"POST",
path,
@@ -299,8 +299,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Membership = {
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
return client.call(
"GET",
path,
@@ -338,8 +338,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Membership = {
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
return client.call(
"PATCH",
path,
@@ -412,8 +412,8 @@ class Teams : Service {
"content-type" to "application/json",
)
val converter: (Any) -> io.appwrite.models.Membership = {
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
io.appwrite.models.Membership.from(map = it as Map<String, Any>)
}
return client.call(
"PATCH",
path,