feat: 1.6.x sdks

This commit is contained in:
Torsten Dittmann
2024-07-03 17:25:40 +02:00
parent c8ee399cb7
commit 5a5609dc0a
4899 changed files with 75595 additions and 15 deletions
@@ -0,0 +1,9 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://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,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://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,9 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.create_jwt()
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,13 @@
from appwrite.client import Client
from appwrite.enums import AuthenticatorType
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
from appwrite.enums import AuthenticationFactor
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.create_mfa_challenge(
factor = AuthenticationFactor.EMAIL
)
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.create_mfa_recovery_codes()
@@ -0,0 +1,15 @@
from appwrite.client import Client
from appwrite.enums import OAuthProvider
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.create_phone_token(
user_id = '<USER_ID>',
phone = '+12065550100'
)
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.create_phone_verification()
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.create_session(
user_id = '<USER_ID>',
secret = '<SECRET>'
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.create(
user_id = '<USER_ID>',
email = 'email@example.com',
password = '',
name = '<NAME>' # optional
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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.enums import AuthenticatorType
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.delete_mfa_authenticator(
type = AuthenticatorType.TOTP,
otp = '<OTP>'
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.delete_sessions()
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.get_mfa_recovery_codes()
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.get_prefs()
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.get()
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.list_identities(
queries = [] # optional
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.list_logs(
queries = [] # optional
)
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.list_mfa_factors()
@@ -0,0 +1,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.list_sessions()
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_mfa(
mfa = False
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.update_magic_url_session(
user_id = '<USER_ID>',
secret = '<SECRET>'
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
from appwrite.enums import AuthenticatorType
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_mfa_recovery_codes()
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_name(
name = '<NAME>'
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
account = Account(client)
result = account.update_phone_session(
user_id = '<USER_ID>',
secret = '<SECRET>'
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_prefs(
prefs = {}
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,10 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
account = Account(client)
result = account.update_status()
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,16 @@
from appwrite.client import Client
from appwrite.enums import Browser
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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 = 0 # optional
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
from appwrite.enums import CreditCard
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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 = 0 # optional
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,16 @@
from appwrite.client import Client
from appwrite.enums import Flag
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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 = 0 # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,15 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,15 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,18 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,19 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,18 @@
from appwrite.client import Client
from appwrite.enums import IndexType
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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
)
@@ -0,0 +1,19 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,20 @@
from appwrite.client import Client
from appwrite.enums import RelationshipType
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,19 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.create(
database_id = '<DATABASE_ID>',
name = '<NAME>',
enabled = False # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.delete_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = ''
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.delete_collection(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>'
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.delete_index(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = ''
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.delete(
database_id = '<DATABASE_ID>'
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.get_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = ''
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.get_collection(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>'
)
@@ -0,0 +1,15 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.get_index(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = ''
)
@@ -0,0 +1,12 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.get(
database_id = '<DATABASE_ID>'
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.list_attributes(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
queries = [] # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.list_collections(
database_id = '<DATABASE_ID>',
queries = [], # optional
search = '<SEARCH>' # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.list_indexes(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
queries = [] # optional
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.list(
queries = [], # optional
search = '<SEARCH>' # optional
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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
)
@@ -0,0 +1,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.update_datetime_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = ''
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # 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
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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'
)
@@ -0,0 +1,17 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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>'
)
@@ -0,0 +1,18 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.update_float_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
min = None,
max = None,
default = None
)
@@ -0,0 +1,18 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.update_integer_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
min = None,
max = None,
default = None
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.update_ip_attribute(
database_id = '<DATABASE_ID>',
collection_id = '<COLLECTION_ID>',
key = '',
required = False,
default = ''
)
@@ -0,0 +1,15 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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>'
)
@@ -0,0 +1,16 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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'
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
databases = Databases(client)
result = databases.update(
database_id = '<DATABASE_ID>',
name = '<NAME>',
enabled = False # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.create_build(
function_id = '<FUNCTION_ID>',
deployment_id = '<DEPLOYMENT_ID>',
build_id = '<BUILD_ID>' # optional
)
@@ -0,0 +1,17 @@
from appwrite.client import Client
from appwrite.input_file import InputFile
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # 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
)
@@ -0,0 +1,18 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_session('') # The user session to authenticate with
functions = Functions(client)
result = functions.create_execution(
function_id = '<FUNCTION_ID>',
body = '<BODY>', # optional
async = False, # optional
path = '<PATH>', # optional
method = ExecutionMethod.GET, # optional
headers = {}, # optional
scheduled_at = '' # optional
)
@@ -0,0 +1,14 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.create_variable(
function_id = '<FUNCTION_ID>',
key = '<KEY>',
value = '<VALUE>'
)
@@ -0,0 +1,33 @@
from appwrite.client import Client
from appwrite.enums import
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.create(
function_id = '<FUNCTION_ID>',
name = '<NAME>',
runtime = .NODE_14_5,
execute = ["any"], # optional
events = [], # optional
schedule = '', # optional
timeout = 1, # optional
enabled = False, # optional
logging = False, # optional
entrypoint = '<ENTRYPOINT>', # optional
commands = '<COMMANDS>', # optional
scopes = [], # optional
installation_id = '<INSTALLATION_ID>', # optional
provider_repository_id = '<PROVIDER_REPOSITORY_ID>', # optional
provider_branch = '<PROVIDER_BRANCH>', # optional
provider_silent_mode = False, # optional
provider_root_directory = '<PROVIDER_ROOT_DIRECTORY>', # optional
template_repository = '<TEMPLATE_REPOSITORY>', # optional
template_owner = '<TEMPLATE_OWNER>', # optional
template_root_directory = '<TEMPLATE_ROOT_DIRECTORY>', # optional
template_branch = '<TEMPLATE_BRANCH>' # optional
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.delete_deployment(
function_id = '<FUNCTION_ID>',
deployment_id = '<DEPLOYMENT_ID>'
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.delete_execution(
function_id = '<FUNCTION_ID>',
execution_id = '<EXECUTION_ID>'
)
@@ -0,0 +1,13 @@
from appwrite.client import Client
client = Client()
client.set_endpoint('https://cloud.appwrite.io/v1') # Your API Endpoint
client.set_project('&lt;YOUR_PROJECT_ID&gt;') # Your project ID
client.set_key('&lt;YOUR_API_KEY&gt;') # Your secret API key
functions = Functions(client)
result = functions.delete_variable(
function_id = '<FUNCTION_ID>',
variable_id = '<VARIABLE_ID>'
)

Some files were not shown because too many files have changed in this diff Show More