mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
Generate SDKs
This commit is contained in:
@@ -19,5 +19,6 @@ result = databases.create_document(
|
||||
"age": 30,
|
||||
"isAdmin": False
|
||||
},
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ databases = Databases(client)
|
||||
result = databases.create_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = []
|
||||
documents = [],
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_operations(
|
||||
transaction_id = '<TRANSACTION_ID>',
|
||||
operations = [
|
||||
{
|
||||
"action": "create",
|
||||
"databaseId": "<DATABASE_ID>",
|
||||
"collectionId": "<COLLECTION_ID>",
|
||||
"documentId": "<DOCUMENT_ID>",
|
||||
"data": {
|
||||
"name": "Walter O'Brien"
|
||||
}
|
||||
}
|
||||
] # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_transaction(
|
||||
ttl = 60 # optional
|
||||
)
|
||||
+2
-1
@@ -14,5 +14,6 @@ result = databases.decrement_document_attribute(
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
attribute = '',
|
||||
value = None, # optional
|
||||
min = None # optional
|
||||
min = None, # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ databases = Databases(client)
|
||||
result = databases.delete_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>'
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ databases = Databases(client)
|
||||
result = databases.delete_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.delete_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>'
|
||||
)
|
||||
@@ -12,5 +12,6 @@ result = databases.get_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.get_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>'
|
||||
)
|
||||
+2
-1
@@ -14,5 +14,6 @@ result = databases.increment_document_attribute(
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
attribute = '',
|
||||
value = None, # optional
|
||||
max = None # optional
|
||||
max = None, # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ databases = Databases(client)
|
||||
result = databases.list_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.list_transactions(
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -13,5 +13,6 @@ result = databases.update_document(
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {}, # optional
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ result = databases.update_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
data = {}, # optional
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.update_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>',
|
||||
commit = False, # optional
|
||||
rollback = False # optional
|
||||
)
|
||||
@@ -13,5 +13,6 @@ result = databases.upsert_document(
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {},
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ databases = Databases(client)
|
||||
result = databases.upsert_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = []
|
||||
documents = [],
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -17,7 +17,7 @@ result = messaging.create_push(
|
||||
targets = [], # optional
|
||||
data = {}, # optional
|
||||
action = '<ACTION>', # optional
|
||||
image = '[ID1:ID2]', # optional
|
||||
image = '<ID1:ID2>', # optional
|
||||
icon = '<ICON>', # optional
|
||||
sound = '<SOUND>', # optional
|
||||
color = '<COLOR>', # optional
|
||||
|
||||
@@ -17,7 +17,7 @@ result = messaging.update_push(
|
||||
body = '<BODY>', # optional
|
||||
data = {}, # optional
|
||||
action = '<ACTION>', # optional
|
||||
image = '[ID1:ID2]', # optional
|
||||
image = '<ID1:ID2>', # optional
|
||||
icon = '<ICON>', # optional
|
||||
sound = '<SOUND>', # optional
|
||||
color = '<COLOR>', # optional
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.create_operations(
|
||||
transaction_id = '<TRANSACTION_ID>',
|
||||
operations = [
|
||||
{
|
||||
"action": "create",
|
||||
"databaseId": "<DATABASE_ID>",
|
||||
"tableId": "<TABLE_ID>",
|
||||
"rowId": "<ROW_ID>",
|
||||
"data": {
|
||||
"name": "Walter O'Brien"
|
||||
}
|
||||
}
|
||||
] # optional
|
||||
)
|
||||
@@ -19,5 +19,6 @@ result = tables_db.create_row(
|
||||
"age": 30,
|
||||
"isAdmin": False
|
||||
},
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ tables_db = TablesDB(client)
|
||||
result = tables_db.create_rows(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
rows = []
|
||||
rows = [],
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.create_transaction(
|
||||
ttl = 60 # optional
|
||||
)
|
||||
@@ -14,5 +14,6 @@ result = tables_db.decrement_row_column(
|
||||
row_id = '<ROW_ID>',
|
||||
column = '',
|
||||
value = None, # optional
|
||||
min = None # optional
|
||||
min = None, # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ tables_db = TablesDB(client)
|
||||
result = tables_db.delete_row(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
row_id = '<ROW_ID>'
|
||||
row_id = '<ROW_ID>',
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ tables_db = TablesDB(client)
|
||||
result = tables_db.delete_rows(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.delete_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>'
|
||||
)
|
||||
@@ -12,5 +12,6 @@ result = tables_db.get_row(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
row_id = '<ROW_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.get_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>'
|
||||
)
|
||||
@@ -14,5 +14,6 @@ result = tables_db.increment_row_column(
|
||||
row_id = '<ROW_ID>',
|
||||
column = '',
|
||||
value = None, # optional
|
||||
max = None # optional
|
||||
max = None, # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ tables_db = TablesDB(client)
|
||||
result = tables_db.list_rows(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.list_transactions(
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -13,5 +13,6 @@ result = tables_db.update_row(
|
||||
table_id = '<TABLE_ID>',
|
||||
row_id = '<ROW_ID>',
|
||||
data = {}, # optional
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -12,5 +12,6 @@ result = tables_db.update_rows(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
data = {}, # optional
|
||||
queries = [] # optional
|
||||
queries = [], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.tables_db import TablesDB
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
tables_db = TablesDB(client)
|
||||
|
||||
result = tables_db.update_transaction(
|
||||
transaction_id = '<TRANSACTION_ID>',
|
||||
commit = False, # optional
|
||||
rollback = False # optional
|
||||
)
|
||||
@@ -13,5 +13,6 @@ result = tables_db.upsert_row(
|
||||
table_id = '<TABLE_ID>',
|
||||
row_id = '<ROW_ID>',
|
||||
data = {}, # optional
|
||||
permissions = ["read("any")"] # optional
|
||||
permissions = ["read("any")"], # optional
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
@@ -11,5 +11,6 @@ tables_db = TablesDB(client)
|
||||
result = tables_db.upsert_rows(
|
||||
database_id = '<DATABASE_ID>',
|
||||
table_id = '<TABLE_ID>',
|
||||
rows = []
|
||||
rows = [],
|
||||
transaction_id = '<TRANSACTION_ID>' # optional
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user