diff --git a/CHANGELOG.md b/CHANGELOG.md index ed8c1769..6b22d7e5 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,10 +1,16 @@ # Change Log +## 25.1.0 + +* Added: Email metadata fields to `User` (`emailCanonical`, `emailIsFree`, `emailIsDisposable`, `emailIsCorporate`, `emailIsCanonical`). +* Added: `Membership.userAccessedAt` field. +* Updated: Requests now send an explicit `accept` header matching each endpoint's response type. + ## 25.0.0 * Breaking: `avatars.getScreenshot` `theme` parameter now uses the `BrowserTheme` enum * Breaking: Removed generic type parameters from `presences` service methods -* Added: `BrowserTheme` enum +* Replaced: `BrowserTheme` enum * Updated: `Presence` model is now concrete and adds a `metadata` field ## 24.1.1 diff --git a/README.md b/README.md index fadaf5f7..74bd3178 100644 --- a/README.md +++ b/README.md @@ -38,7 +38,7 @@ repositories { Next, add the dependency to your project's `build.gradle(.kts)` file: ```groovy -implementation("io.appwrite:sdk-for-android:25.0.0") +implementation("io.appwrite:sdk-for-android:25.1.0") ``` ### Maven @@ -49,7 +49,7 @@ Add this to your project's `pom.xml` file: io.appwrite sdk-for-android - 25.0.0 + 25.1.0 ``` diff --git a/docs/examples/java/account/update-password.md b/docs/examples/java/account/update-password.md index 075a869b..93562d57 100644 --- a/docs/examples/java/account/update-password.md +++ b/docs/examples/java/account/update-password.md @@ -11,7 +11,7 @@ Account account = new Account(client); account.updatePassword( "", // password - "password", // oldPassword (optional) + "", // oldPassword (optional) new CoroutineCallback<>((result, error) -> { if (error != null) { error.printStackTrace(); diff --git a/docs/examples/kotlin/account/update-password.md b/docs/examples/kotlin/account/update-password.md index ce9ae904..dd8a06b8 100644 --- a/docs/examples/kotlin/account/update-password.md +++ b/docs/examples/kotlin/account/update-password.md @@ -11,6 +11,6 @@ val account = Account(client) val result = account.updatePassword( password = "", - oldPassword = "password", // (optional) + oldPassword = "", // (optional) ) ``` diff --git a/library/src/main/java/io/appwrite/Client.kt b/library/src/main/java/io/appwrite/Client.kt index f43ec95a..f51628d0 100644 --- a/library/src/main/java/io/appwrite/Client.kt +++ b/library/src/main/java/io/appwrite/Client.kt @@ -94,7 +94,7 @@ class Client @JvmOverloads constructor( "x-sdk-name" to "Android", "x-sdk-platform" to "client", "x-sdk-language" to "android", - "x-sdk-version" to "25.0.0", + "x-sdk-version" to "25.1.0", "x-appwrite-response-format" to "1.9.5" ) config = mutableMapOf() @@ -113,7 +113,6 @@ class Client @JvmOverloads constructor( */ fun setProject(value: String): Client { config["project"] = value - addHeader("x-appwrite-project", value) return this } @@ -366,7 +365,10 @@ class Client @JvmOverloads constructor( suspend fun ping(): String { val apiPath = "/ping" val apiParams = mutableMapOf() - val apiHeaders = mutableMapOf("content-type" to "application/json") + val apiHeaders = mutableMapOf( + "content-type" to "application/json", + "X-Appwrite-Project" to config["project"].orEmpty(), + ) return call( "GET", diff --git a/library/src/main/java/io/appwrite/models/Membership.kt b/library/src/main/java/io/appwrite/models/Membership.kt index eb13be3b..afcbdf77 100644 --- a/library/src/main/java/io/appwrite/models/Membership.kt +++ b/library/src/main/java/io/appwrite/models/Membership.kt @@ -85,6 +85,12 @@ data class Membership( @SerializedName("mfa") val mfa: Boolean, + /** + * Most recent access date in ISO 8601 format. Show this attribute by toggling membership privacy in the Console. + */ + @SerializedName("userAccessedAt") + val userAccessedAt: String, + /** * User list of roles */ @@ -106,6 +112,7 @@ data class Membership( "joined" to joined as Any, "confirm" to confirm as Any, "mfa" to mfa as Any, + "userAccessedAt" to userAccessedAt as Any, "roles" to roles as Any, ) @@ -128,6 +135,7 @@ data class Membership( joined = map["joined"] as String, confirm = map["confirm"] as Boolean, mfa = map["mfa"] as Boolean, + userAccessedAt = map["userAccessedAt"] as String, roles = map["roles"] as List, ) } diff --git a/library/src/main/java/io/appwrite/models/User.kt b/library/src/main/java/io/appwrite/models/User.kt index a76d61f0..ff66ba72 100644 --- a/library/src/main/java/io/appwrite/models/User.kt +++ b/library/src/main/java/io/appwrite/models/User.kt @@ -91,6 +91,36 @@ data class User( @SerializedName("emailVerification") val emailVerification: Boolean, + /** + * Canonical form of the user email address. + */ + @SerializedName("emailCanonical") + var emailCanonical: String?, + + /** + * Whether the user email is from a free email provider. + */ + @SerializedName("emailIsFree") + var emailIsFree: Boolean?, + + /** + * Whether the user email is from a disposable email provider. + */ + @SerializedName("emailIsDisposable") + var emailIsDisposable: Boolean?, + + /** + * Whether the user email is from a corporate domain. + */ + @SerializedName("emailIsCorporate") + var emailIsCorporate: Boolean?, + + /** + * Whether the user email is in its canonical form. + */ + @SerializedName("emailIsCanonical") + var emailIsCanonical: Boolean?, + /** * Phone verification status. */ @@ -149,6 +179,11 @@ data class User( "email" to email as Any, "phone" to phone as Any, "emailVerification" to emailVerification as Any, + "emailCanonical" to emailCanonical as Any, + "emailIsFree" to emailIsFree as Any, + "emailIsDisposable" to emailIsDisposable as Any, + "emailIsCorporate" to emailIsCorporate as Any, + "emailIsCanonical" to emailIsCanonical as Any, "phoneVerification" to phoneVerification as Any, "mfa" to mfa as Any, "prefs" to prefs.toMap() as Any, @@ -174,6 +209,11 @@ data class User( email: String, phone: String, emailVerification: Boolean, + emailCanonical: String?, + emailIsFree: Boolean?, + emailIsDisposable: Boolean?, + emailIsCorporate: Boolean?, + emailIsCanonical: Boolean?, phoneVerification: Boolean, mfa: Boolean, prefs: Preferences>, @@ -196,6 +236,11 @@ data class User( email, phone, emailVerification, + emailCanonical, + emailIsFree, + emailIsDisposable, + emailIsCorporate, + emailIsCanonical, phoneVerification, mfa, prefs, @@ -224,6 +269,11 @@ data class User( email = map["email"] as String, phone = map["phone"] as String, emailVerification = map["emailVerification"] as Boolean, + emailCanonical = map["emailCanonical"] as? String, + emailIsFree = map["emailIsFree"] as? Boolean, + emailIsDisposable = map["emailIsDisposable"] as? Boolean, + emailIsCorporate = map["emailIsCorporate"] as? Boolean, + emailIsCanonical = map["emailIsCanonical"] as? Boolean, phoneVerification = map["phoneVerification"] as Boolean, mfa = map["mfa"] as Boolean, prefs = Preferences.from(map = map["prefs"] as Map, nestedType), diff --git a/library/src/main/java/io/appwrite/services/Account.kt b/library/src/main/java/io/appwrite/services/Account.kt index 6e2244c3..5f9ee7b4 100644 --- a/library/src/main/java/io/appwrite/services/Account.kt +++ b/library/src/main/java/io/appwrite/services/Account.kt @@ -31,6 +31,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -83,7 +85,9 @@ class Account(client: Client) : Service(client) { "name" to name, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -144,7 +148,9 @@ class Account(client: Client) : Service(client) { "password" to password, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -198,6 +204,8 @@ class Account(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.IdentityList = { @Suppress("UNCHECKED_CAST") @@ -229,6 +237,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -257,7 +266,9 @@ class Account(client: Client) : Service(client) { "duration" to duration, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Jwt = { @Suppress("UNCHECKED_CAST") @@ -293,6 +304,8 @@ class Account(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.LogList = { @Suppress("UNCHECKED_CAST") @@ -325,7 +338,9 @@ class Account(client: Client) : Service(client) { "mfa" to mfa, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -374,7 +389,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaType = { @Suppress("UNCHECKED_CAST") @@ -406,7 +423,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaType = { @Suppress("UNCHECKED_CAST") @@ -446,7 +465,9 @@ class Account(client: Client) : Service(client) { "otp" to otp, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -502,7 +523,9 @@ class Account(client: Client) : Service(client) { "otp" to otp, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -554,6 +577,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -581,6 +605,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -612,7 +637,9 @@ class Account(client: Client) : Service(client) { "factor" to factor, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaChallenge = { @Suppress("UNCHECKED_CAST") @@ -644,7 +671,9 @@ class Account(client: Client) : Service(client) { "factor" to factor, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaChallenge = { @Suppress("UNCHECKED_CAST") @@ -683,7 +712,9 @@ class Account(client: Client) : Service(client) { "otp" to otp, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -718,7 +749,9 @@ class Account(client: Client) : Service(client) { "otp" to otp, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -751,6 +784,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaFactors = { @Suppress("UNCHECKED_CAST") @@ -779,6 +814,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaFactors = { @Suppress("UNCHECKED_CAST") @@ -811,6 +848,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -839,6 +878,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -871,7 +912,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -900,7 +943,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -933,7 +978,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -962,7 +1009,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MfaRecoveryCodes = { @Suppress("UNCHECKED_CAST") @@ -995,7 +1044,9 @@ class Account(client: Client) : Service(client) { "name" to name, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -1029,7 +1080,7 @@ class Account(client: Client) : Service(client) { * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param password New user password. Must be at least 8 chars. - * @param oldPassword Current user password. Must be at least 8 chars. + * @param oldPassword Current user password. Max length: 256 chars. * @return [io.appwrite.models.User] */ @JvmOverloads @@ -1045,7 +1096,9 @@ class Account(client: Client) : Service(client) { "oldPassword" to oldPassword, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -1065,7 +1118,7 @@ class Account(client: Client) : Service(client) { * Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth, Team Invites and Magic URL, oldPassword is optional. * * @param password New user password. Must be at least 8 chars. - * @param oldPassword Current user password. Must be at least 8 chars. + * @param oldPassword Current user password. Max length: 256 chars. * @return [io.appwrite.models.User] */ @JvmOverloads @@ -1098,7 +1151,9 @@ class Account(client: Client) : Service(client) { "password" to password, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -1144,6 +1199,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Preferences = { @Suppress("UNCHECKED_CAST") @@ -1186,7 +1243,9 @@ class Account(client: Client) : Service(client) { "prefs" to prefs, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -1234,7 +1293,9 @@ class Account(client: Client) : Service(client) { "url" to url, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -1274,7 +1335,9 @@ class Account(client: Client) : Service(client) { "password" to password, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -1303,6 +1366,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.SessionList = { @Suppress("UNCHECKED_CAST") @@ -1331,6 +1396,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -1355,7 +1421,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1392,7 +1460,9 @@ class Account(client: Client) : Service(client) { "password" to password, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1431,7 +1501,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1547,7 +1619,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1582,7 +1656,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1614,6 +1690,8 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1645,7 +1723,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Session = { @Suppress("UNCHECKED_CAST") @@ -1677,6 +1757,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -1702,7 +1783,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.User = { @Suppress("UNCHECKED_CAST") @@ -1751,7 +1834,9 @@ class Account(client: Client) : Service(client) { "providerId" to providerId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Target = { @Suppress("UNCHECKED_CAST") @@ -1786,7 +1871,9 @@ class Account(client: Client) : Service(client) { "identifier" to identifier, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Target = { @Suppress("UNCHECKED_CAST") @@ -1818,6 +1905,7 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -1855,7 +1943,9 @@ class Account(client: Client) : Service(client) { "phrase" to phrase, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -1900,7 +1990,9 @@ class Account(client: Client) : Service(client) { "phrase" to phrase, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2013,7 +2105,9 @@ class Account(client: Client) : Service(client) { "phone" to phone, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2048,7 +2142,9 @@ class Account(client: Client) : Service(client) { "url" to url, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2087,7 +2183,9 @@ class Account(client: Client) : Service(client) { "url" to url, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2122,7 +2220,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2161,7 +2261,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2190,7 +2292,9 @@ class Account(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") @@ -2225,7 +2329,9 @@ class Account(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Token = { @Suppress("UNCHECKED_CAST") diff --git a/library/src/main/java/io/appwrite/services/Databases.kt b/library/src/main/java/io/appwrite/services/Databases.kt index 2fc95889..ce4e8327 100644 --- a/library/src/main/java/io/appwrite/services/Databases.kt +++ b/library/src/main/java/io/appwrite/services/Databases.kt @@ -30,6 +30,8 @@ class Databases(client: Client) : Service(client) { "queries" to queries, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.TransactionList = { @Suppress("UNCHECKED_CAST") @@ -62,7 +64,9 @@ class Databases(client: Client) : Service(client) { "ttl" to ttl, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -94,6 +98,8 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -132,7 +138,9 @@ class Databases(client: Client) : Service(client) { "rollback" to rollback, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -164,6 +172,7 @@ class Databases(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -195,7 +204,9 @@ class Databases(client: Client) : Service(client) { "operations" to operations, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -248,6 +259,8 @@ class Databases(client: Client) : Service(client) { "ttl" to ttl, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.DocumentList = { @Suppress("UNCHECKED_CAST") @@ -333,7 +346,9 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") @@ -416,6 +431,8 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") @@ -498,7 +515,9 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") @@ -584,7 +603,9 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") @@ -663,6 +684,7 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -714,7 +736,9 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") @@ -806,7 +830,9 @@ class Databases(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Document = { @Suppress("UNCHECKED_CAST") diff --git a/library/src/main/java/io/appwrite/services/Functions.kt b/library/src/main/java/io/appwrite/services/Functions.kt index 12a5fee5..191c8cc9 100644 --- a/library/src/main/java/io/appwrite/services/Functions.kt +++ b/library/src/main/java/io/appwrite/services/Functions.kt @@ -36,6 +36,8 @@ class Functions(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.ExecutionList = { @Suppress("UNCHECKED_CAST") @@ -86,7 +88,9 @@ class Functions(client: Client) : Service(client) { "scheduledAt" to scheduledAt, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Execution = { @Suppress("UNCHECKED_CAST") @@ -121,6 +125,8 @@ class Functions(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Execution = { @Suppress("UNCHECKED_CAST") diff --git a/library/src/main/java/io/appwrite/services/Graphql.kt b/library/src/main/java/io/appwrite/services/Graphql.kt index 1c714748..950366ee 100644 --- a/library/src/main/java/io/appwrite/services/Graphql.kt +++ b/library/src/main/java/io/appwrite/services/Graphql.kt @@ -29,8 +29,10 @@ class Graphql(client: Client) : Service(client) { "query" to query, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "x-sdk-graphql" to "true", "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> Any = { it @@ -61,8 +63,10 @@ class Graphql(client: Client) : Service(client) { "query" to query, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "x-sdk-graphql" to "true", "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> Any = { it diff --git a/library/src/main/java/io/appwrite/services/Locale.kt b/library/src/main/java/io/appwrite/services/Locale.kt index d6acb84d..d662ac65 100644 --- a/library/src/main/java/io/appwrite/services/Locale.kt +++ b/library/src/main/java/io/appwrite/services/Locale.kt @@ -28,6 +28,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Locale = { @Suppress("UNCHECKED_CAST") @@ -56,6 +58,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.LocaleCodeList = { @Suppress("UNCHECKED_CAST") @@ -84,6 +88,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.ContinentList = { @Suppress("UNCHECKED_CAST") @@ -112,6 +118,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.CountryList = { @Suppress("UNCHECKED_CAST") @@ -140,6 +148,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.CountryList = { @Suppress("UNCHECKED_CAST") @@ -168,6 +178,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.PhoneList = { @Suppress("UNCHECKED_CAST") @@ -196,6 +208,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.CurrencyList = { @Suppress("UNCHECKED_CAST") @@ -224,6 +238,8 @@ class Locale(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.LanguageList = { @Suppress("UNCHECKED_CAST") diff --git a/library/src/main/java/io/appwrite/services/Messaging.kt b/library/src/main/java/io/appwrite/services/Messaging.kt index ee2444d9..bf0d246a 100644 --- a/library/src/main/java/io/appwrite/services/Messaging.kt +++ b/library/src/main/java/io/appwrite/services/Messaging.kt @@ -35,7 +35,9 @@ class Messaging(client: Client) : Service(client) { "targetId" to targetId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Subscriber = { @Suppress("UNCHECKED_CAST") @@ -70,6 +72,7 @@ class Messaging(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( diff --git a/library/src/main/java/io/appwrite/services/Presences.kt b/library/src/main/java/io/appwrite/services/Presences.kt index 21d234a6..bebcb50e 100644 --- a/library/src/main/java/io/appwrite/services/Presences.kt +++ b/library/src/main/java/io/appwrite/services/Presences.kt @@ -37,6 +37,8 @@ class Presences(client: Client) : Service(client) { "ttl" to ttl, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.PresenceList = { @Suppress("UNCHECKED_CAST") @@ -69,6 +71,8 @@ class Presences(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Presence = { @Suppress("UNCHECKED_CAST") @@ -114,7 +118,9 @@ class Presences(client: Client) : Service(client) { "metadata" to metadata, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Presence = { @Suppress("UNCHECKED_CAST") @@ -163,7 +169,9 @@ class Presences(client: Client) : Service(client) { "purge" to purge, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Presence = { @Suppress("UNCHECKED_CAST") @@ -196,6 +204,7 @@ class Presences(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( diff --git a/library/src/main/java/io/appwrite/services/Storage.kt b/library/src/main/java/io/appwrite/services/Storage.kt index 8276d082..ec073dff 100644 --- a/library/src/main/java/io/appwrite/services/Storage.kt +++ b/library/src/main/java/io/appwrite/services/Storage.kt @@ -41,6 +41,8 @@ class Storage(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.FileList = { @Suppress("UNCHECKED_CAST") @@ -90,7 +92,9 @@ class Storage(client: Client) : Service(client) { "permissions" to permissions, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "multipart/form-data", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.File = { @Suppress("UNCHECKED_CAST") @@ -129,6 +133,8 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.File = { @Suppress("UNCHECKED_CAST") @@ -170,7 +176,9 @@ class Storage(client: Client) : Service(client) { "permissions" to permissions, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.File = { @Suppress("UNCHECKED_CAST") @@ -205,6 +213,7 @@ class Storage(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( diff --git a/library/src/main/java/io/appwrite/services/TablesDB.kt b/library/src/main/java/io/appwrite/services/TablesDB.kt index 9c5a955e..8595a4ff 100644 --- a/library/src/main/java/io/appwrite/services/TablesDB.kt +++ b/library/src/main/java/io/appwrite/services/TablesDB.kt @@ -30,6 +30,8 @@ class TablesDB(client: Client) : Service(client) { "queries" to queries, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.TransactionList = { @Suppress("UNCHECKED_CAST") @@ -62,7 +64,9 @@ class TablesDB(client: Client) : Service(client) { "ttl" to ttl, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -94,6 +98,8 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -132,7 +138,9 @@ class TablesDB(client: Client) : Service(client) { "rollback" to rollback, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -164,6 +172,7 @@ class TablesDB(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -195,7 +204,9 @@ class TablesDB(client: Client) : Service(client) { "operations" to operations, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Transaction = { @Suppress("UNCHECKED_CAST") @@ -244,6 +255,8 @@ class TablesDB(client: Client) : Service(client) { "ttl" to ttl, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.RowList = { @Suppress("UNCHECKED_CAST") @@ -321,7 +334,9 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") @@ -396,6 +411,8 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") @@ -470,7 +487,9 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") @@ -548,7 +567,9 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") @@ -619,6 +640,7 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -666,7 +688,9 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") @@ -750,7 +774,9 @@ class TablesDB(client: Client) : Service(client) { "transactionId" to transactionId, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Row = { @Suppress("UNCHECKED_CAST") diff --git a/library/src/main/java/io/appwrite/services/Teams.kt b/library/src/main/java/io/appwrite/services/Teams.kt index 78019a1d..1ab6c54a 100644 --- a/library/src/main/java/io/appwrite/services/Teams.kt +++ b/library/src/main/java/io/appwrite/services/Teams.kt @@ -37,6 +37,8 @@ class Teams(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.TeamList = { @Suppress("UNCHECKED_CAST") @@ -96,7 +98,9 @@ class Teams(client: Client) : Service(client) { "roles" to roles, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Team = { @Suppress("UNCHECKED_CAST") @@ -149,6 +153,8 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Team = { @Suppress("UNCHECKED_CAST") @@ -197,7 +203,9 @@ class Teams(client: Client) : Service(client) { "name" to name, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Team = { @Suppress("UNCHECKED_CAST") @@ -245,6 +253,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -282,6 +291,8 @@ class Teams(client: Client) : Service(client) { "total" to total, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.MembershipList = { @Suppress("UNCHECKED_CAST") @@ -339,7 +350,9 @@ class Teams(client: Client) : Service(client) { "name" to name, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @Suppress("UNCHECKED_CAST") @@ -374,6 +387,8 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @Suppress("UNCHECKED_CAST") @@ -412,7 +427,9 @@ class Teams(client: Client) : Service(client) { "roles" to roles, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @Suppress("UNCHECKED_CAST") @@ -447,6 +464,7 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", ) return client.call( @@ -486,7 +504,9 @@ class Teams(client: Client) : Service(client) { "secret" to secret, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Membership = { @Suppress("UNCHECKED_CAST") @@ -519,6 +539,8 @@ class Teams(client: Client) : Service(client) { val apiParams = mutableMapOf( ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Preferences = { @Suppress("UNCHECKED_CAST") @@ -567,7 +589,9 @@ class Teams(client: Client) : Service(client) { "prefs" to prefs, ) val apiHeaders = mutableMapOf( + "X-Appwrite-Project" to client.config["project"].orEmpty(), "content-type" to "application/json", + "accept" to "application/json", ) val converter: (Any) -> io.appwrite.models.Preferences = { @Suppress("UNCHECKED_CAST")