mirror of
https://github.com/appwrite/sdk-for-android.git
synced 2026-04-07 19:17:49 +00:00
update to appwrite 1.3.0
This commit is contained in:
@@ -11,7 +11,7 @@ Account account = new Account(client);
|
||||
account.create(
|
||||
"[USER_ID]",
|
||||
"email@example.com",
|
||||
"password",
|
||||
"",
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -9,7 +9,7 @@ Client client = new Client(context)
|
||||
Account account = new Account(client);
|
||||
|
||||
account.updatePassword(
|
||||
"password",
|
||||
"",
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -11,7 +11,7 @@ Databases databases = new Databases(client);
|
||||
databases.getDocument(
|
||||
"[DATABASE_ID]",
|
||||
"[COLLECTION_ID]",
|
||||
"[DOCUMENT_ID]"
|
||||
"[DOCUMENT_ID]",
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -10,7 +10,6 @@ Teams teams = new Teams(client);
|
||||
|
||||
teams.createMembership(
|
||||
"[TEAM_ID]",
|
||||
"email@example.com",
|
||||
listOf(),
|
||||
"https://example.com",
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Teams;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Teams teams = new Teams(client);
|
||||
|
||||
teams.getPrefs(
|
||||
"[TEAM_ID]"
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
@@ -8,7 +8,7 @@ Client client = new Client(context)
|
||||
|
||||
Teams teams = new Teams(client);
|
||||
|
||||
teams.update(
|
||||
teams.updateName(
|
||||
"[TEAM_ID]",
|
||||
"[NAME]"
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
@@ -0,0 +1,22 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Teams;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2"); // Your project ID
|
||||
|
||||
Teams teams = new Teams(client);
|
||||
|
||||
teams.updatePrefs(
|
||||
"[TEAM_ID]",
|
||||
mapOf( "a" to "b" )
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
return;
|
||||
}
|
||||
|
||||
Log.d("Appwrite", result.toString());
|
||||
})
|
||||
);
|
||||
@@ -10,5 +10,5 @@ val account = Account(client)
|
||||
val response = account.create(
|
||||
userId = "[USER_ID]",
|
||||
email = "email@example.com",
|
||||
password = "password",
|
||||
password = "",
|
||||
)
|
||||
|
||||
@@ -8,5 +8,5 @@ val client = Client(context)
|
||||
val account = Account(client)
|
||||
|
||||
val response = account.updatePassword(
|
||||
password = "password",
|
||||
password = "",
|
||||
)
|
||||
|
||||
@@ -10,5 +10,5 @@ val databases = Databases(client)
|
||||
val response = databases.getDocument(
|
||||
databaseId = "[DATABASE_ID]",
|
||||
collectionId = "[COLLECTION_ID]",
|
||||
documentId = "[DOCUMENT_ID]"
|
||||
documentId = "[DOCUMENT_ID]",
|
||||
)
|
||||
|
||||
@@ -9,7 +9,6 @@ val teams = Teams(client)
|
||||
|
||||
val response = teams.createMembership(
|
||||
teamId = "[TEAM_ID]",
|
||||
email = "email@example.com",
|
||||
roles = listOf(),
|
||||
url = "https://example.com",
|
||||
)
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.services.Teams
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
val teams = Teams(client)
|
||||
|
||||
val response = teams.getPrefs(
|
||||
teamId = "[TEAM_ID]"
|
||||
)
|
||||
@@ -7,7 +7,7 @@ val client = Client(context)
|
||||
|
||||
val teams = Teams(client)
|
||||
|
||||
val response = teams.update(
|
||||
val response = teams.updateName(
|
||||
teamId = "[TEAM_ID]",
|
||||
name = "[NAME]"
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.services.Teams
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://[HOSTNAME_OR_IP]/v1") // Your API Endpoint
|
||||
.setProject("5df5acd0d48c2") // Your project ID
|
||||
|
||||
val teams = Teams(client)
|
||||
|
||||
val response = teams.updatePrefs(
|
||||
teamId = "[TEAM_ID]",
|
||||
prefs = mapOf( "a" to "b" )
|
||||
)
|
||||
Reference in New Issue
Block a user