mirror of
https://github.com/appwrite/appwrite.git
synced 2026-05-26 13:51:13 +00:00
update: generate docs examples as per latest 1.8.x source.
This commit is contained in:
@@ -0,0 +1,10 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_anonymous_session()
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_email_password_session(
|
||||
email = 'email@example.com',
|
||||
password = 'password'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_email_token(
|
||||
user_id = '<USER_ID>',
|
||||
email = 'email@example.com',
|
||||
phrase = False # optional
|
||||
)
|
||||
@@ -0,0 +1,10 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_jwt()
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_magic_url_token(
|
||||
user_id = '<USER_ID>',
|
||||
email = 'email@example.com',
|
||||
url = 'https://example.com', # optional
|
||||
phrase = False # optional
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
from appwrite.enums import AuthenticatorType
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_mfa_authenticator(
|
||||
type = AuthenticatorType.TOTP
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
from appwrite.enums import AuthenticationFactor
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_mfa_challenge(
|
||||
factor = AuthenticationFactor.EMAIL
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_mfa_recovery_codes()
|
||||
@@ -0,0 +1,16 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
from appwrite.enums import OAuthProvider
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_o_auth2_token(
|
||||
provider = OAuthProvider.AMAZON,
|
||||
success = 'https://example.com', # optional
|
||||
failure = 'https://example.com', # optional
|
||||
scopes = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_phone_token(
|
||||
user_id = '<USER_ID>',
|
||||
phone = '+12065550100'
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_phone_verification()
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_recovery(
|
||||
email = 'email@example.com',
|
||||
url = 'https://example.com'
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_session(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>'
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create_verification(
|
||||
url = 'https://example.com'
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.create(
|
||||
user_id = '<USER_ID>',
|
||||
email = 'email@example.com',
|
||||
password = '',
|
||||
name = '<NAME>' # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.delete_identity(
|
||||
identity_id = '<IDENTITY_ID>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
from appwrite.enums import AuthenticatorType
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.delete_mfa_authenticator(
|
||||
type = AuthenticatorType.TOTP
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.delete_session(
|
||||
session_id = '<SESSION_ID>'
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.delete_sessions()
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.get_mfa_recovery_codes()
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.get_prefs()
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.get_session(
|
||||
session_id = '<SESSION_ID>'
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.get()
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.list_identities(
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.list_logs(
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.list_mfa_factors()
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.list_sessions()
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_email(
|
||||
email = 'email@example.com',
|
||||
password = 'password'
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_mfa(
|
||||
mfa = False
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_magic_url_session(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>'
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
from appwrite.enums import AuthenticatorType
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_mfa_authenticator(
|
||||
type = AuthenticatorType.TOTP,
|
||||
otp = '<OTP>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_mfa_challenge(
|
||||
challenge_id = '<CHALLENGE_ID>',
|
||||
otp = '<OTP>'
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_mfa_recovery_codes()
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_name(
|
||||
name = '<NAME>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_password(
|
||||
password = '',
|
||||
old_password = 'password' # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
client = Client()
|
||||
client.set_endpoint('https://<REGION>.cloud.appwrite.io/v1') # Your API Endpoint
|
||||
client.set_project('<YOUR_PROJECT_ID>') # Your project ID
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_phone_session(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_phone_verification(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_phone(
|
||||
phone = '+12065550100',
|
||||
password = 'password'
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_prefs(
|
||||
prefs = {}
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_recovery(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>',
|
||||
password = ''
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_session(
|
||||
session_id = '<SESSION_ID>'
|
||||
)
|
||||
@@ -0,0 +1,11 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_status()
|
||||
@@ -0,0 +1,14 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.account import Account
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
account = Account(client)
|
||||
|
||||
result = account.update_verification(
|
||||
user_id = '<USER_ID>',
|
||||
secret = '<SECRET>'
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
from appwrite.enums import Browser
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_browser(
|
||||
code = Browser.AVANT_BROWSER,
|
||||
width = 0, # optional
|
||||
height = 0, # optional
|
||||
quality = -1 # optional
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
from appwrite.enums import CreditCard
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_credit_card(
|
||||
code = CreditCard.AMERICAN_EXPRESS,
|
||||
width = 0, # optional
|
||||
height = 0, # optional
|
||||
quality = -1 # optional
|
||||
)
|
||||
@@ -0,0 +1,13 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_favicon(
|
||||
url = 'https://example.com'
|
||||
)
|
||||
@@ -0,0 +1,17 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
from appwrite.enums import Flag
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_flag(
|
||||
code = Flag.AFGHANISTAN,
|
||||
width = 0, # optional
|
||||
height = 0, # optional
|
||||
quality = -1 # optional
|
||||
)
|
||||
@@ -0,0 +1,15 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_image(
|
||||
url = 'https://example.com',
|
||||
width = 0, # optional
|
||||
height = 0 # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_initials(
|
||||
name = '<NAME>', # optional
|
||||
width = 0, # optional
|
||||
height = 0, # optional
|
||||
background = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.avatars import Avatars
|
||||
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
avatars = Avatars(client)
|
||||
|
||||
result = avatars.get_qr(
|
||||
text = '<TEXT>',
|
||||
size = 1, # optional
|
||||
margin = 0, # optional
|
||||
download = False # 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.create_boolean_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = False, # optional
|
||||
array = False # 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.create_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
name = '<NAME>',
|
||||
permissions = ["read("any")"], # optional
|
||||
document_security = False, # optional
|
||||
enabled = False # 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.create_datetime_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '', # optional
|
||||
array = False # 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_session('') # The user session to authenticate with
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {},
|
||||
permissions = ["read("any")"] # 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_admin('') #
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.create_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
documents = []
|
||||
)
|
||||
@@ -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.create_email_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'email@example.com', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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_enum_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
elements = [],
|
||||
required = False,
|
||||
default = '<DEFAULT>', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_float_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
default = None, # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
from appwrite.enums import IndexType
|
||||
|
||||
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_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
type = IndexType.KEY,
|
||||
attributes = [],
|
||||
orders = [], # optional
|
||||
lengths = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_integer_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
default = None, # optional
|
||||
array = False # 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.create_ip_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '', # optional
|
||||
array = False # optional
|
||||
)
|
||||
@@ -0,0 +1,21 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.databases import Databases
|
||||
from appwrite.enums import RelationshipType
|
||||
|
||||
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_relationship_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
related_collection_id = '<RELATED_COLLECTION_ID>',
|
||||
type = RelationshipType.ONETOONE,
|
||||
two_way = False, # optional
|
||||
key = '', # optional
|
||||
two_way_key = '', # optional
|
||||
on_delete = RelationMutate.CASCADE # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_string_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
size = 1,
|
||||
required = False,
|
||||
default = '<DEFAULT>', # optional
|
||||
array = False, # optional
|
||||
encrypt = False # 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.create_url_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'https://example.com', # optional
|
||||
array = False # 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.create(
|
||||
database_id = '<DATABASE_ID>',
|
||||
name = '<NAME>',
|
||||
enabled = False # 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.decrement_document_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
attribute = '',
|
||||
value = None, # optional
|
||||
min = None # 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.delete_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>'
|
||||
)
|
||||
@@ -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_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.delete_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>'
|
||||
)
|
||||
@@ -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.delete_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # 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.delete_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -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(
|
||||
database_id = '<DATABASE_ID>'
|
||||
)
|
||||
@@ -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.get_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>'
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
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_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.get_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
queries = [] # 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.get_index(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = ''
|
||||
)
|
||||
@@ -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(
|
||||
database_id = '<DATABASE_ID>'
|
||||
)
|
||||
@@ -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.increment_document_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
attribute = '',
|
||||
value = None, # optional
|
||||
max = None # 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.list_attributes(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # 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.list_collections(
|
||||
database_id = '<DATABASE_ID>',
|
||||
queries = [], # optional
|
||||
search = '<SEARCH>' # 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_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.list_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # 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.list_indexes(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
queries = [] # optional
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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(
|
||||
queries = [], # optional
|
||||
search = '<SEARCH>' # 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_boolean_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = False,
|
||||
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_collection(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
name = '<NAME>',
|
||||
permissions = ["read("any")"], # optional
|
||||
document_security = False, # optional
|
||||
enabled = False # 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_datetime_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '',
|
||||
new_key = '' # 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_session('') # The user session to authenticate with
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.update_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>',
|
||||
data = {}, # optional
|
||||
permissions = ["read("any")"] # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
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_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
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_email_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'email@example.com',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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_enum_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
elements = [],
|
||||
required = False,
|
||||
default = '<DEFAULT>',
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_float_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = None,
|
||||
min = None, # optional
|
||||
max = None, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,20 @@
|
||||
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_integer_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = None,
|
||||
min = None, # optional
|
||||
max = None, # 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_ip_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '',
|
||||
new_key = '' # 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.update_relationship_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
on_delete = RelationMutate.CASCADE, # optional
|
||||
new_key = '' # optional
|
||||
)
|
||||
@@ -0,0 +1,19 @@
|
||||
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_string_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = '<DEFAULT>',
|
||||
size = 1, # 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_url_attribute(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
key = '',
|
||||
required = False,
|
||||
default = 'https://example.com',
|
||||
new_key = '' # 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(
|
||||
database_id = '<DATABASE_ID>',
|
||||
name = '<NAME>',
|
||||
enabled = False # optional
|
||||
)
|
||||
@@ -0,0 +1,16 @@
|
||||
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_session('') # The user session to authenticate with
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
client.set_jwt('<YOUR_JWT>') # Your secret JSON Web Token
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.upsert_document(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>',
|
||||
document_id = '<DOCUMENT_ID>'
|
||||
)
|
||||
@@ -0,0 +1,14 @@
|
||||
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_admin('') #
|
||||
client.set_key('<YOUR_API_KEY>') # Your secret API key
|
||||
|
||||
databases = Databases(client)
|
||||
|
||||
result = databases.upsert_documents(
|
||||
database_id = '<DATABASE_ID>',
|
||||
collection_id = '<COLLECTION_ID>'
|
||||
)
|
||||
@@ -0,0 +1,18 @@
|
||||
from appwrite.client import Client
|
||||
from appwrite.services.functions import Functions
|
||||
from appwrite.input_file import InputFile
|
||||
|
||||
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
|
||||
|
||||
functions = Functions(client)
|
||||
|
||||
result = functions.create_deployment(
|
||||
function_id = '<FUNCTION_ID>',
|
||||
code = InputFile.from_path('file.png'),
|
||||
activate = False,
|
||||
entrypoint = '<ENTRYPOINT>', # optional
|
||||
commands = '<COMMANDS>' # optional
|
||||
)
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user