mirror of
https://github.com/appwrite/sdk-for-android.git
synced 2026-04-07 19:17:49 +00:00
Add operators
This commit is contained in:
@@ -10,6 +10,7 @@ Account account = new Account(client);
|
||||
|
||||
account.listIdentities(
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -10,6 +10,7 @@ Account account = new Account(client);
|
||||
|
||||
account.listLogs(
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -19,7 +21,7 @@ databases.createDocument(
|
||||
"age" to 30,
|
||||
"isAdmin" to false
|
||||
), // data
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ databases.listDocuments(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
listOf(), // queries (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ databases.updateDocument(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<DOCUMENT_ID>", // documentId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Databases;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ databases.upsertDocument(
|
||||
"<COLLECTION_ID>", // collectionId
|
||||
"<DOCUMENT_ID>", // documentId
|
||||
mapOf( "a" to "b" ), // data
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -11,6 +11,7 @@ Functions functions = new Functions(client);
|
||||
functions.listExecutions(
|
||||
"<FUNCTION_ID>", // functionId
|
||||
listOf(), // queries (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -2,6 +2,8 @@ import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.models.InputFile;
|
||||
import io.appwrite.services.Storage;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ storage.createFile(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<FILE_ID>", // fileId
|
||||
InputFile.fromPath("file.png"), // file
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -12,6 +12,7 @@ storage.listFiles(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.Storage;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,7 +14,7 @@ storage.updateFile(
|
||||
"<BUCKET_ID>", // bucketId
|
||||
"<FILE_ID>", // fileId
|
||||
"<NAME>", // name (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.TablesDB;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -19,7 +21,7 @@ tablesDB.createRow(
|
||||
"age" to 30,
|
||||
"isAdmin" to false
|
||||
), // data
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -13,6 +13,7 @@ tablesDB.listRows(
|
||||
"<TABLE_ID>", // tableId
|
||||
listOf(), // queries (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.TablesDB;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ tablesDB.updateRow(
|
||||
"<TABLE_ID>", // tableId
|
||||
"<ROW_ID>", // rowId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client;
|
||||
import io.appwrite.coroutines.CoroutineCallback;
|
||||
import io.appwrite.services.TablesDB;
|
||||
import io.appwrite.Permission;
|
||||
import io.appwrite.Role;
|
||||
|
||||
Client client = new Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,7 +15,7 @@ tablesDB.upsertRow(
|
||||
"<TABLE_ID>", // tableId
|
||||
"<ROW_ID>", // rowId
|
||||
mapOf( "a" to "b" ), // data (optional)
|
||||
listOf("read("any")"), // permissions (optional)
|
||||
listOf(Permission.read(Role.any())), // permissions (optional)
|
||||
"<TRANSACTION_ID>", // transactionId (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
|
||||
@@ -12,6 +12,7 @@ teams.listMemberships(
|
||||
"<TEAM_ID>", // teamId
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -11,6 +11,7 @@ Teams teams = new Teams(client);
|
||||
teams.list(
|
||||
listOf(), // queries (optional)
|
||||
"<SEARCH>", // search (optional)
|
||||
false, // total (optional)
|
||||
new CoroutineCallback<>((result, error) -> {
|
||||
if (error != null) {
|
||||
error.printStackTrace();
|
||||
|
||||
@@ -10,4 +10,5 @@ val account = Account(client)
|
||||
|
||||
val result = account.listIdentities(
|
||||
queries = listOf(), // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -10,4 +10,5 @@ val account = Account(client)
|
||||
|
||||
val result = account.listLogs(
|
||||
queries = listOf(), // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -19,6 +21,6 @@ val result = databases.createDocument(
|
||||
"age" to 30,
|
||||
"isAdmin" to false
|
||||
),
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -13,4 +13,5 @@ val result = databases.listDocuments(
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
queries = listOf(), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,6 +15,6 @@ val result = databases.updateDocument(
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documentId = "<DOCUMENT_ID>",
|
||||
data = mapOf( "a" to "b" ), // (optional)
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Databases
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,6 +15,6 @@ val result = databases.upsertDocument(
|
||||
collectionId = "<COLLECTION_ID>",
|
||||
documentId = "<DOCUMENT_ID>",
|
||||
data = mapOf( "a" to "b" ),
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -11,4 +11,5 @@ val functions = Functions(client)
|
||||
val result = functions.listExecutions(
|
||||
functionId = "<FUNCTION_ID>",
|
||||
queries = listOf(), // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -2,6 +2,8 @@ import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.models.InputFile
|
||||
import io.appwrite.services.Storage
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,5 +15,5 @@ val result = storage.createFile(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
fileId = "<FILE_ID>",
|
||||
file = InputFile.fromPath("file.png"),
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
)
|
||||
@@ -12,4 +12,5 @@ val result = storage.listFiles(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
queries = listOf(), // (optional)
|
||||
search = "<SEARCH>", // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.Storage
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -12,5 +14,5 @@ val result = storage.updateFile(
|
||||
bucketId = "<BUCKET_ID>",
|
||||
fileId = "<FILE_ID>",
|
||||
name = "<NAME>", // (optional)
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.TablesDB
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -19,6 +21,6 @@ val result = tablesDB.createRow(
|
||||
"age" to 30,
|
||||
"isAdmin" to false
|
||||
),
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -13,4 +13,5 @@ val result = tablesDB.listRows(
|
||||
tableId = "<TABLE_ID>",
|
||||
queries = listOf(), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.TablesDB
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,6 +15,6 @@ val result = tablesDB.updateRow(
|
||||
tableId = "<TABLE_ID>",
|
||||
rowId = "<ROW_ID>",
|
||||
data = mapOf( "a" to "b" ), // (optional)
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -1,6 +1,8 @@
|
||||
import io.appwrite.Client
|
||||
import io.appwrite.coroutines.CoroutineCallback
|
||||
import io.appwrite.services.TablesDB
|
||||
import io.appwrite.Permission
|
||||
import io.appwrite.Role
|
||||
|
||||
val client = Client(context)
|
||||
.setEndpoint("https://<REGION>.cloud.appwrite.io/v1") // Your API Endpoint
|
||||
@@ -13,6 +15,6 @@ val result = tablesDB.upsertRow(
|
||||
tableId = "<TABLE_ID>",
|
||||
rowId = "<ROW_ID>",
|
||||
data = mapOf( "a" to "b" ), // (optional)
|
||||
permissions = listOf("read("any")"), // (optional)
|
||||
permissions = listOf(Permission.read(Role.any())), // (optional)
|
||||
transactionId = "<TRANSACTION_ID>", // (optional)
|
||||
)
|
||||
@@ -12,4 +12,5 @@ val result = teams.listMemberships(
|
||||
teamId = "<TEAM_ID>",
|
||||
queries = listOf(), // (optional)
|
||||
search = "<SEARCH>", // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
@@ -11,4 +11,5 @@ val teams = Teams(client)
|
||||
val result = teams.list(
|
||||
queries = listOf(), // (optional)
|
||||
search = "<SEARCH>", // (optional)
|
||||
total = false, // (optional)
|
||||
)
|
||||
Reference in New Issue
Block a user