feat: update examples

This commit is contained in:
Chirag Aggarwal
2025-09-05 17:30:39 +05:30
parent a9dbd6c3fa
commit 23c433c2ed
333 changed files with 3576 additions and 192 deletions
@@ -9,5 +9,9 @@ client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_prefs(
prefs = {}
prefs = {
"language": "en",
"timezone": "UTC",
"darkTheme": True
}
)
@@ -12,6 +12,12 @@ result = databases.create_document(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
document_id = '<DOCUMENT_ID>',
data = {},
data = {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": False
},
permissions = ["read("any")"] # optional
)
@@ -0,0 +1,17 @@
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_line_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -0,0 +1,17 @@
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_point_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -0,0 +1,17 @@
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_polygon_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -12,6 +12,6 @@ result = databases.update_document(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
document_id = '<DOCUMENT_ID>',
data = {}, # optional
data = [], # optional
permissions = ["read("any")"] # optional
)
@@ -11,6 +11,6 @@ databases = Databases(client)
result = databases.update_documents(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
data = {}, # optional
data = [], # optional
queries = [] # optional
)
@@ -0,0 +1,18 @@
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_line_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -0,0 +1,18 @@
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_point_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -0,0 +1,18 @@
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_polygon_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -12,6 +12,6 @@ result = databases.upsert_document(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
document_id = '<DOCUMENT_ID>',
data = {},
data = [],
permissions = ["read("any")"] # optional
)
@@ -14,6 +14,6 @@ result = functions.create_execution(
async = False, # optional
path = '<PATH>', # optional
method = ExecutionMethod.GET, # optional
headers = {}, # optional
headers = [], # optional
scheduled_at = '<SCHEDULED_AT>' # optional
)
@@ -9,5 +9,5 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key
graphql = Graphql(client)
result = graphql.mutation(
query = {}
query = []
)
@@ -9,5 +9,5 @@ client.set_key('<YOUR_API_KEY>') # Your secret API key
graphql = Graphql(client)
result = graphql.query(
query = {}
query = []
)
@@ -11,6 +11,6 @@ messaging = Messaging(client)
result = messaging.create_fcm_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>',
service_account_json = {}, # optional
service_account_json = [], # optional
enabled = False # optional
)
@@ -15,7 +15,7 @@ result = messaging.create_push(
topics = [], # optional
users = [], # optional
targets = [], # optional
data = {}, # optional
data = [], # optional
action = '<ACTION>', # optional
image = '[ID1:ID2]', # optional
icon = '<ICON>', # optional
@@ -12,5 +12,5 @@ result = messaging.update_fcm_provider(
provider_id = '<PROVIDER_ID>',
name = '<NAME>', # optional
enabled = False, # optional
service_account_json = {} # optional
service_account_json = [] # optional
)
@@ -15,7 +15,7 @@ result = messaging.update_push(
targets = [], # optional
title = '<TITLE>', # optional
body = '<BODY>', # optional
data = {}, # optional
data = [], # optional
action = '<ACTION>', # optional
image = '[ID1:ID2]', # optional
icon = '<ICON>', # optional
@@ -0,0 +1,17 @@
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_line_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -0,0 +1,17 @@
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_point_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -0,0 +1,17 @@
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_polygon_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '' # optional
)
@@ -12,6 +12,12 @@ result = tables_db.create_row(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
row_id = '<ROW_ID>',
data = {},
data = {
"username": "walter.obrien",
"email": "walter.obrien@example.com",
"fullName": "Walter O'Brien",
"age": 30,
"isAdmin": False
},
permissions = ["read("any")"] # optional
)
@@ -0,0 +1,18 @@
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_line_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -0,0 +1,18 @@
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_point_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -0,0 +1,18 @@
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_polygon_column(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
key = '',
required = False,
default = '', # optional
new_key = '' # optional
)
@@ -12,6 +12,6 @@ result = tables_db.update_row(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
row_id = '<ROW_ID>',
data = {}, # optional
data = [], # optional
permissions = ["read("any")"] # optional
)
@@ -11,6 +11,6 @@ tables_db = TablesDB(client)
result = tables_db.update_rows(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
data = {}, # optional
data = [], # optional
queries = [] # optional
)
@@ -12,6 +12,6 @@ result = tables_db.upsert_row(
database_id = '<DATABASE_ID>',
table_id = '<TABLE_ID>',
row_id = '<ROW_ID>',
data = {}, # optional
data = [], # optional
permissions = ["read("any")"] # optional
)
@@ -10,5 +10,5 @@ teams = Teams(client)
result = teams.update_prefs(
team_id = '<TEAM_ID>',
prefs = {}
prefs = []
)
@@ -10,5 +10,5 @@ users = Users(client)
result = users.update_prefs(
user_id = '<USER_ID>',
prefs = {}
prefs = []
)